N
netbug
Unregistered / Unconfirmed
GUEST, unregistred user!
请看下例:
procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Clear;
form1.ClientSocket1.Address:='202.104.32.238';
form1.ClientSocket1.Port:=23;
form1.ClientSocket1.Active:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.ClientSocket1.Active:=false;
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
memo1.Lines.Add(socket.LocalAddress);
memo1.Lines.Add(socket.LocalHost);
memo1.Lines.Add(inttostr(socket.LocalPort));
memo1.Lines.Add(socket.RemoteHost);
memo1.Lines.Add(socket.RemoteAddress);
memo1.Lines.Add(inttostr(socket.RemotePort));
memo1.Lines.Add(socket.ReceiveText);
memo1.Lines.Add(socket.ReceiveText);
end;
procedure TForm1.ClientSocket1Write(Sender: TObject;
Socket: TCustomWinSocket);
begin
socket.SendText('hello');
end;
我在温旧吧下用telnet 202.104.32.238,并为23端口可以远程登陆上,我用此程序
就没有任何动静,甚至连向此端口发送的'hello'、本地及远程的地址都没有显示
出来?请问我该如何做才行?
谢谢。
procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Clear;
form1.ClientSocket1.Address:='202.104.32.238';
form1.ClientSocket1.Port:=23;
form1.ClientSocket1.Active:=true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.ClientSocket1.Active:=false;
end;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
memo1.Lines.Add(socket.LocalAddress);
memo1.Lines.Add(socket.LocalHost);
memo1.Lines.Add(inttostr(socket.LocalPort));
memo1.Lines.Add(socket.RemoteHost);
memo1.Lines.Add(socket.RemoteAddress);
memo1.Lines.Add(inttostr(socket.RemotePort));
memo1.Lines.Add(socket.ReceiveText);
memo1.Lines.Add(socket.ReceiveText);
end;
procedure TForm1.ClientSocket1Write(Sender: TObject;
Socket: TCustomWinSocket);
begin
socket.SendText('hello');
end;
我在温旧吧下用telnet 202.104.32.238,并为23端口可以远程登陆上,我用此程序
就没有任何动静,甚至连向此端口发送的'hello'、本地及远程的地址都没有显示
出来?请问我该如何做才行?
谢谢。