急急...肯定给分.请问谁有关于INDY组件的详细资料呢?最好是idTcpServer和idTcpClient的. 肯定给分.请问谁有关于INDY组件的详细资料呢?最好是idTcpServer和idTcpClient的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.indyproject.org/Sockets/Docs/index.en.iwpindy的文档 http://www.delphibox.com/article.asp?articleid=1780indy的例子 去google上面搜索,结果相当多 http://translate.google.com/translate?hl=zh-CN&sl=en&u=http://www.indyproject.org/&prev=/search%3Fq%3DINDY%26hl%3Dzh-CN%26lr%3D%26inlang%3Dzh-CN%26newwindow%3D1 我也找过文档,不过好像是英文的,还是下载demo看看吧,也许理解的更快 这玩意更新太快,直接看demo和源码中注释吧 其实Indy比较简单,但是可以提供的方法太多了。我找了很久,才搞明白。比方说这个读取缓冲区的数据,就有很多种方法。相对于TTcpClient的几种方法来说,TIdTCPClient确实提供了多种选择,不仔细研究真的容易糊涂(其实我比较喜欢用CurrentReadBuffer):1、ReadFromStack原型:function ReadFromStack(const ARaiseExceptionIfDisconnected: boolean; const ATimeout: integer; const AUseBuffer: boolean; ADestStream: TIdBuffer): integer; virtual;用于判断缓冲区里是否还有数据可读,返回值:Integer - Number of bytes read.2、CurrentReadBuffer原型:function CurrentReadBuffer: string;用于读取Socket数据到缓冲区,注意返回为String类型,如果直接显示该String的数据,对于\0之后的数据可能看不到,因此要读取所有的数据,还必须利用CurrentReadBufferSize()判断该String的长度。返回值:String - Contents of the Indy buffer.3、GetResponse原型:function GetResponse(const AAllowedResponses: Array of SmallInt): SmallInt; virtual;对于简单的命令应答可以使用这个方法获取应答消息,返回值:SmallInt - The numeric response number.4、ReadBuffer原型:procedure ReadBuffer(var ABuffer; const AByteCount: Longint);读取指定数目的字节到缓冲区ABuffer,注意它会调用 ReadFromStack 以检查缓冲区里的数据是否少于AByteCount5、ReadInteger原型:function ReadInteger(const AConvert: boolean): Integer;从缓冲区中读取整型数据,它会调用ReadBuffer6、ReadLn原型:function ReadLn(const ATerminator: string; const ATimeout: integer): string; virtual;读取移行记录,带有一个TimeOut属性,以防止在读不到新行时死循环。返回值:String - Line read from the buffer.注意行分隔符可能是以下几种:#0 - Default Line Feed (#10)LF - Line Feed (#10)CR - Carriage Return (#13)EOL - End-of-line (Carriage Return + Line Feed)7、ReadLnWait:原型:function ReadLnWait: string;很像ReadLn,但它会一直傻傻的等待8、ReadSmallInt原型:function ReadSmallInt(const AConvert: boolean): SmallInt;9、ReadStream原型:procedure ReadStream(AStream: TStream; AByteCount: LongInt; const AReadUntilDisconnect: boolean);10、ReadString原型:function ReadString(const ABytes: integer): string;与CurrentReadBuffer的不同在于它读取指定长度的字符串 Delphi 2007代码编辑器问题 Delphi用Olecontainer实现word分页显示的问题。 求救,ADOQuery的问题!!! 将Windows桌面分成几个区域,实现比如控制最大最小化区域设定。 delphi中事件调用的问题(在线等) treeview中,当选中某一个结点时会触发一个什么事件? 一个非常奇怪的问题? 如何操作Delphi 如何拆分时间成:年,月,日,时,分,秒 谁能把delphi6中的FTP范例发给我? 请问以下代码打开的窗口,窗口关闭后,内存里还有这个窗口吗? 100分求以下两个API函数
indy的例子
原型:function ReadFromStack(const ARaiseExceptionIfDisconnected: boolean; const ATimeout: integer; const AUseBuffer: boolean; ADestStream: TIdBuffer): integer; virtual;
用于判断缓冲区里是否还有数据可读,返回值:Integer - Number of bytes read.2、CurrentReadBuffer
原型:function CurrentReadBuffer: string;
用于读取Socket数据到缓冲区,注意返回为String类型,如果直接显示该String的数据,对于\0之后的数据可能看不到,因此要读取所有的数据,还必须利用CurrentReadBufferSize()判断该String的长度。
返回值:String - Contents of the Indy buffer.3、GetResponse
原型:function GetResponse(const AAllowedResponses: Array of SmallInt): SmallInt; virtual;
对于简单的命令应答可以使用这个方法获取应答消息,返回值:SmallInt - The numeric response number.4、ReadBuffer
原型:procedure ReadBuffer(var ABuffer; const AByteCount: Longint);
读取指定数目的字节到缓冲区ABuffer,注意它会调用 ReadFromStack 以检查缓冲区里的数据是否少于AByteCount5、ReadInteger
原型:function ReadInteger(const AConvert: boolean): Integer;
从缓冲区中读取整型数据,它会调用ReadBuffer6、ReadLn
原型:function ReadLn(const ATerminator: string; const ATimeout: integer): string; virtual;
读取移行记录,带有一个TimeOut属性,以防止在读不到新行时死循环。返回值:String - Line read from the buffer.
注意行分隔符可能是以下几种:
#0 - Default Line Feed (#10)
LF - Line Feed (#10)
CR - Carriage Return (#13)
EOL - End-of-line (Carriage Return + Line Feed)7、ReadLnWait:
原型:function ReadLnWait: string;
很像ReadLn,但它会一直傻傻的等待8、ReadSmallInt
原型:function ReadSmallInt(const AConvert: boolean): SmallInt;9、ReadStream
原型:procedure ReadStream(AStream: TStream; AByteCount: LongInt; const AReadUntilDisconnect: boolean);10、ReadString
原型:function ReadString(const ABytes: integer): string;
与CurrentReadBuffer的不同在于它读取指定长度的字符串