我试验过自己的程序,没有你说的问题。
你试验试验在调用新的GET前,先调用nmhttp1.cancel;

解决方案 »

  1.   

    加NMHTTP1.CANCEL的方法好象不太好使,那个错误还是会出现,不知还有没有什么
    更好的方法,各位高手大侠,救救我这个可怜人吧:..(
      

  2.   

    我的代码为:
        for i:=5 downto 1 do
        begin
            Form1.NMHTTP1.Get('10.1.1.5/xxx.php?id=xxx');
            Receivestr := Form1.NMHTTP1.Body;
            .....
        end;
    我要向同一个php文件提交5个不同的id,不一定在做第几次时出错。
    谁能救救我,helpme
      

  3.   

      就我所知,好多网络方面控件的方法是直接返回的。
      例如你所说的Get函数,它不会使程序停下来等待Get的结果,
    而是直接执行下一句。Get执行完后,根据结果,触发一个表示
    成功或失败的事件。你应该在这些事件中去处理。
      

  4.   

      就我所知,好多网络方面控件的方法是直接返回的。
      例如你所说的Get函数,它不会使程序停下来等待Get的结果,
    而是直接执行下一句。Get执行完后,根据结果,触发一个表示
    成功或失败的事件。你应该在这些事件中去处理。
      

  5.   

      就我所知,好多网络方面控件的方法是直接返回的。
      例如你所说的Get函数,它不会使程序停下来等待Get的结果,
    而是直接执行下一句。Get执行完后,根据结果,触发一个表示
    成功或失败的事件。你应该在这些事件中去处理。
      

  6.   

    我记得Get不会等待结果的,而是直接返回,执行下一语句。
    根据Get的不同结果,会发生不同的事件,例如成功事件或
    是失败事件。你对结果进行处理的代码和下一次的Get调用
    应该放到相应的事件中去。
      

  7.   

    如果要是时间间隔太短的话,那要如何增加时间的间隔,有没有例子,
    如果有的话请mailto: [email protected],谢谢^_^
      

  8.   

    每次按下回复按钮,都会出现页面不能显示的错误。于是重复做了几次,没想到...下面是Help中对TNMHTTP.GET方法的描述:
    Applies to
    TNMHTTP componentDeclaration
    procedure Get(URL: string); virtual;Description
    The Get method retrieves the document specified by the URL parameter. If InputFileMode is TRUE, the document retrieved by the Get method is stored in the file that is specified by the Body property, and the header is stored in the file that is specified by the Header property.If InputFileMode is FALSE, the document retrieved by the Get method is stored in the Body property as a string. The header is stored in the Header property as a string.Parameters:
    The URL parameter specifies the document to retrieve. 
    这里很明显的指出:如果操作成功,会产生OnSuccess事件,失败的话,会产生
    OnFailure事件。
    所以你程序当中对结果进行处理以及开始下一个Get的代码应该放到这两个事件中。
    Note:
    If the operation is successful, the OnSuccess event is called, passing CmdGET as the Cmd parameter.
    If the operation fails, the OnFailure event is called, passing CmdGET as the Cmd parameter.
      

  9.   

    前几天按下“回复”按钮后,都出现页面不能现实的错误,于是坚持不懈的暗了好几次,
    就变成上面这样,出现了好多贴子. Sorry以下是Delphi帮助文件中关于TNMHTTP.GET部分。
    Declaration
    procedure Get(URL: string); virtual;Description
    The Get method retrieves the document specified by the URL parameter. If InputFileMode is TRUE, the document retrieved by the Get method is stored in the file that is specified by the Body property, and the header is stored in the file that is specified by the Header property.If InputFileMode is FALSE, the document retrieved by the Get method is stored in the Body property as a string. The header is stored in the Header property as a string.Parameters:
    The URL parameter specifies the document to retrieve. 下面部分明确指出,如果Get操作成功,将会产生OnSuccess事件,否则,会产生
    OnFailure事件。Note:
    If the operation is successful, the OnSuccess event is called, passing CmdGET as the Cmd parameter.
    If the operation fails, the OnFailure event is called, passing CmdGET as the Cmd parameter.
    很明显,你的程序中,执行Receivestr := Form1.NMHTTP1.Body时,Get并没有完成,
    不可能获得你想要的数据。
    还有,如果在下一次调用Get时,上一次的Get还没有完成话,就会出现错误。你应该将代码
    begin
            Form1.NMHTTP1.Get('10.1.1.5/xxx.php?id=xxx');
            Receivestr := Form1.NMHTTP1.Body;
            .....
    end;
    放到TNMHTTP.OnSuccess中去,并且应该调换两句的位置,获得上次的结果后,
    再调用下一个Get.
    还有应该在OnFailure中放入相应的错误处理代码。