TcpClient.Sendln()这个东西怎么用?在线等待

xiaoxiaomifeng 2003-10-23 07:18:42
TcpClient.Sendln('FKMIS')

ClientSocket.Receiveln

我用的这个系统里为什么一定要发送"FKMIS",才能接收到,发送其它的为什么不行,是不是在什么地方定义过?如果是,在什么地方定义?
...全文
181 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoxiaomifeng 2003-10-24
  • 打赏
  • 举报
回复
to dickeybird888(于伟刚)
我问的是TcpClient.Sendln('FKMIS')的"FKMIS"在哪里定义过?TTcpServer对象收到这个信息后再返回指定的内容,由ClientSocket.Receiveln接收
dickeybird888 2003-10-23
  • 打赏
  • 举报
回复
给你一个用indy TCPClient的例子。(获取指定网页内容)
c 是TIdTCPClient, Host设为HTTP Server主机,端口80
procedure TForm1.Button1Click(Sender: TObject);
var
S: String;
Len: Integer;
begin
c.Connect;
c.writeln('GET / HTTP/1.1');
c.writeln('Content-Type: text/html');
c.writeln('Host: www.delphibbs.com');
c.writeln('Accept: text/html,*/*');
c.writeln('User-Agent: Mozilla/3.0 (compatible; Indy Library)');
c.writeln('');
Len := 0;
repeat
s := c.readln;
if Copy(S, 1, 14) = 'Content-Length' then
Len := StrToInt(Copy(S, 16, MAXINT));
until s = '';
S := c.ReadString(Len);
memo1.lines.text := s;
end;
zhxfzhxf1 2003-10-23
  • 打赏
  • 举报
回复
不知道,帮你up
vagerent 2003-10-23
  • 打赏
  • 举报
回复
不知道,帮你up

829

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧