unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets, StdCtrls;
type
TForm1 =
class(TForm)
TcpClient1: TTcpClient;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure TcpClient1Connect(Sender: TObject);
procedure TcpClient1Receive(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
tcpclient1.RemoteHost := '
irc.undernet.org';
tcpclient1.RemotePort := '
6667';
tcpclient1.Connect;
//tcpclient1.Open;
end;
procedure TForm1.TcpClient1Connect(Sender: TObject);
begin
showmessage('
Connect');
tcpclient1.Sendln('
NICK testnick'+#13#10);
tcpclient1.Sendln('
USER nick undernet :testnick'+#13#10);
end;
procedure TForm1.TcpClient1Receive(Sender: TObject; Buf: PAnsiChar;
var DataLen: Integer);
begin
showmessage('
RECIEVE');
memo1.Lines.Add(Buf);
end;
end.