unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Sockets, ShellCtrls, ComCtrls;
type
TForm1 =
class(TForm)
clientstatus: TEdit;
shelltreeview: TShellTreeView;
TcpClient1: TTcpClient;
procedure TcpClient1Connect(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TcpClient1Send(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
procedure TcpClient1Error(Sender: TObject; SocketError: Integer);
procedure TcpClient1Disconnect(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
test: TTreeNodes;
implementation
{$R *.dfm}
procedure TForm1.TcpClient1Connect(Sender: TObject);
begin
test:= shelltreeview.Items;
clientstatus.Text:='
Client verbunden';
tcpclient1.SendBuf(test,sizeof(test));
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
tcpclient1.Close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
tcpclient1.Connect;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
tcpclient1.Connect;
tcpclient1.Open;
end;
procedure TForm1.TcpClient1Send(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
begin
clientstatus.Text:='
sendet';
end;
procedure TForm1.TcpClient1Error(Sender: TObject; SocketError: Integer);
begin
clientstatus.Text:='
Fehler';
end;
procedure TForm1.TcpClient1Disconnect(Sender: TObject);
begin
clientstatus.Text:='
getrennt'
end;
end.