网络高手指导一下,INDY老是提交错误,有代码(30)

冬月

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ToolWin, IdCookieManager, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, ExtCtrls;type TForm1 = class(TForm) IdHTTP1: TIdHTTP; IdCookieManager1: TIdCookieManager; ToolBar1: TToolBar; LoginBtn: TButton; ToolButton1: TToolButton; Memo1: TMemo; Button1: TButton; ToolButton2: TToolButton; Timer1: TTimer; procedure LoginBtnClick(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure IdHTTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.LoginBtnClick(Sender: TObject);var Params:TStrings; res:TStringStream; Url,Str1,Str2:String;begin IdHTTP1.ReadTimeout:= 25000; IdHTTP1.AllowCookies:=True; IdHTTP1.HTTPOptions:=[hoForceEncodeParams]; IdHTTP1.ProtocolVersion:=pv1_1; //Str1:='image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-silverlight, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*'; IdHTTP1.Request.Accept:='Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; IdHTTP1.Request.AcceptEncoding:= 'gzip, deflate'; IdHTTP1.Request.AcceptLanguage:= 'zh-cn'; IdHTTP1.Request.CacheControl:= 'no-cache'; IdHTTP1.Request.Connection:= 'Keep-Alive'; IdHTTP1.Request.ContentLength:=144; IdHTTP1.Request.ContentType:= 'application/x-www-form-urlencoded'; IdHTTP1.Request.Host:= 'passport.19lou.com'; IdHTTP1.Request.Referer:= 'http://www.19lou.com/'; IdHTTP1.Request.UserAgent:= 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)'; Params :=TStringList.Create; try Params.Append('33676ba36586e6250535f0ac64279a27=02a57cfe0dfba9619c502202df1d787a'); Params.Append('autoLogin=1'); Params.Append('login=?'); Params.Append('userName=odbc'); Params.Append('userPass=odbc'); try Url := 'http://passport.19lou.com/login/index/t/normal'; IdHTTP1.HandleRedirects:=True; res := TStringStream.Create(''); IdHTTP1.Post(Url,Params,res); UTF8Decode(TStringStream(IdHTTP1.Response.ContentStream).dataString); Memo1.Lines.Add(res.DataString); except end; finally Params.Free; end;end;procedure TForm1.IdHTTP1WorkEnd(Sender: TObject; AWorkMode: TWorkMode);begin Memo1.Lines.Add('****************************(DEBUG开始)***************************'); Memo1.Lines.Add('=======(访问页面)========='); Memo1.Lines.Add(IdHTTP1.URL.URI); Memo1.Lines.Add('=======(页面信息)========='); Memo1.Lines.Add(IdHttp1.ResponseText); Memo1.Lines.Add('=======(页面反馈)========='); Memo1.Lines.Add('-------[发送过去的信息]---------------'); Memo1.Lines.AddStrings(IdHTTP1.Request.RawHeaders); Memo1.Lines.Add('-------[发送过去的自定义信息]---------------'); Memo1.Lines.AddStrings(IdHTTP1.Request.CustomHeaders); Memo1.Lines.Add('-------[返回回来的信息]---------------'); Memo1.Lines.AddStrings(IdHTTP1.Response.RawHeaders); Memo1.Lines.Add('-------[返回回来的自定义信息]---------------'); Memo1.Lines.AddStrings(IdHTTP1.Response.CustomHeaders); Memo1.Lines.Add('=======(页面内容)========='); Memo1.Lines.Add(UTF8Decode(TStringStream(IdHTTP1.Response.ContentStream).dataString)); Memo1.Lines.Add('***************************(DEBUG结束)***************************');end;end.始终说我是非法提交,请问为什么?
 
L

linchhero

Unregistered / Unconfirmed
GUEST, unregistred user!
这么简单的问题!
 
N

Notouch

Unregistered / Unconfirmed
GUEST, unregistred user!
跟到里面去看看错误应该在post的时候触发的
 
Top Bottom