"Projiect Project2.exe raised exception class EIdHTTProtocolException with message 'HTTP/1.1 302 Object moved'.Process stoped. Use Step or Run to continue."
不知道什么原因?请大虾指教。

解决方案 »

  1.   

    hehe, 其実這個問題在我執行你的程序時、早就発現了。
    因此在上一個貼中己写出原因、只是你没看或当時没看明白而己、現在再給你写一遍。你的网页「自动发贴的功能」順序是:
    「guest.asp」-> 「write.asp」-> 「guest.asp」
    发贴時在「guest.asp」网页登録、把登録内容送給「write.asp」認証、
    然後再返回「guest.asp」、因此网页代码在「guest.asp」中、而不是在「write.asp」
    若从「write.asp」取网页代码就会出錯、因此把発送和取网页代码分成二部分做。try
      {...}
      IdHTTP1.Post('http://vote.inhe.net/guestbook/write.asp', postList); //発送
    finally
      Memo1.Lines.Text := IdHTTP1.Get('http://vote.inhe.net/guestbook/guest.asp?user=newsre');  //从「guest.asp」取网页代码
     postList.Free;
    end;
      

  2.   

    这回,我明白了! 但程序还是有问题,我如你所说改了代码,错误依然存在。我又把取回网页的功能去掉,错误还是存在!看来是post的问题!
      

  3.   

    ”302 Object Moved ”的意思是:
     This code indicates that the requested node is not maintained by the server. The response includes the new URL for that node. A response of this type is typically received in response to a request to a router.在上一個貼中有我写的用「WebBrowser1」発送的↓、
    WebBrowser1.Navigate(SList.Strings[0],EmptyParam,EmptyParam,PostData,Headers);
    因WebBrowser1会自動的変換http addr、所以不会出ERROR。建義你用「WebBrowser1」発送、用「IdHTTP1」取网页代码。