procedure TForm1.Button1Click(Sender: TObject);
begin
Clientsocket1.host := edit1.text;
clientsocket1.port := 80;
Clientsocket1.open;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
clientsocket1.close;
\\kod för två knappar
procedure TForm1.ClientSocket1Connecting(Sender: TObject;
Socket: TCustomWinSocket);
begin
hmtext := '';
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
hmtext := hmtext + socket.ReceiveText;
end;
procedure TForm1.ClientSocket1Disconnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
memo1.clear;
memo1.Lines.Add(hmtext);
Clientsocket1.close;
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
hmtext := atext + socket.ReceiveText;
end;
procedure TForm1.ClientSocket1Write(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.SendText('GET ' + webbsida + ' HTTP/1.0'#10#10);
end;