unit Unit1;
interface
uses
SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms,
QDialogs, QStdCtrls, Sockets, QExtCtrls;
type
TfrmMain =
class(TForm)
tcpClient: TTcpClient;
tmrTimer: TTimer;
procedure tcpClientError(Sender: TObject; SocketError: Integer);
procedure tcpClientConnect(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure CheckNews();
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.xfm}
procedure TfrmMain.CheckNews;
begin
tcpClient.RemoteHost := '
http://www.heise.de';
tcpClient.RemotePort := '
80';
tcpClient.Open;
end;
procedure TfrmMain.tcpClientError(Sender: TObject; SocketError: Integer);
begin
ShowMessage(IntToStr(SocketError));
end;
procedure TfrmMain.tcpClientConnect(Sender: TObject);
begin
ShowMessage('
connected');
end;
procedure TfrmMain.FormCreate(Sender: TObject);
begin
CheckNews;
end;
end.