肯定给分.请问谁有关于INDY组件的详细资料呢?最好是idTcpServer和idTcpClient的.

解决方案 »

  1.   

    http://www.indyproject.org/Sockets/Docs/index.en.iwpindy的文档
      

  2.   

    http://www.delphibox.com/article.asp?articleid=1780
    indy的例子
      

  3.   

    去google上面搜索,结果相当多
      

  4.   

    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
      

  5.   

    我也找过文档,不过好像是英文的,还是下载demo看看吧,也许理解的更快
      

  6.   

    这玩意更新太快,直接看demo和源码中注释吧
      

  7.   

    其实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的不同在于它读取指定长度的字符串