服务端客户端连接查看远程桌面操作
提示:服务端客户端连接,查看客户端桌面操作
例如:
用到的组件,分服务端和客户端
提示:服务端
提示:客户端
核心源代码
提示:服务端
procedure TForm1.FormCreate(Sender: TObject);
begin
MyFormJpeg := TJPEGImage.Create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
IdTCPServer1.Active := false;
IdTCPServer1.Bindings.Clear;
MyFormJpeg.Free;
end;
procedure TForm1.IdTCPServer1Connect(AContext: TIdContext);
begin
TMyNotify.AddTextToMemo(‘Connected from: IP’ + AContext.Binding.PeerIP +
’ Port: ’ + IntToStr(AContext.Binding.Port) + ’ / ’ +
IntToStr(AContext.Binding.PeerPort));
end;
procedure TForm1.IdTCPServer1Disconnect(AContext: TIdContext);
begin
TMyNotify.AddTextToMemo(‘Disconnected from: IP’ + AContext.Binding.PeerIP +
’ Port: ’ + IntToStr(AContext.Binding.Port) + ’ / ’ +
IntToStr(AContext.Binding.PeerPort));
end;
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
Response: string;
fstream: TMemoryStream;
MyJpegImage: TJPEGImage;
tempBuf: tidbytes;
begin
Response := AContext.Connection.IOHandler.ReadLn;
if Response = ‘jpg’ then
begin
MyJpegImage := TJPEGImage.Create;
fstream := TMemoryStream.Create;
try
TMySync.DoTh