unit Chat_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Sockets;
type
TForm2 =
class(TForm)
MemoRecive: TMemo;
EdNick: TEdit;
EdIp: TEdit;
EdPort: TEdit;
BtnSend: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
MemoSend: TMemo;
BtnConnect: TButton;
ClientSocket: TTcpClient;
procedure BtnConnectClick(Sender: TObject);
procedure ClientSocketReceive(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
EdPort :
string ;
implementation
{$R *.dfm}
procedure TForm2.BtnConnectClick(Sender: TObject);
begin
begin
ClientSocket.RemoteHost:=EdIP.Text;
//Die IP wird festgelegt
ClientSocket.RemotePort:= EdPort.text;
//Der Port wird festgelegt
ClientSocket.Open;
//Verbindung zum Server wird hergestellt
if ClientSocket.Active = true
then
BtnSend.Enabled := true;
end;
end;
procedure TForm2.ClientSocketReceive(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
begin;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
BtnSend.Enabled := false;
end;
end.