百度未果 請兄弟們給出解決思路 最好再給出代碼或者幫看下下面的代碼問題處在哪裡怎麼擴充!!謝謝
procedure TForm1.Button1Click(Sender: TObject);
var postList:TStrings;
Response:TStringStream;
url:string; myIH:TIdHTTP;
IdSSLIOHandlerSocketOpenSSL1:TIdSSLIOHandlerSocketOpenSSL;
begin
Response:=TStringStream.Create('');
postList:=TStringList.Create;
try
myIH:=TIdHTTP.Create(nil);
IdSSLIOHandlerSocketOpenSSL1:=TIdSSLIOHandlerSocketOpenSSL.Create(nil);
myIH.IOHandler:=IdSSLIOHandlerSocketOpenSSL1;
myIH.HandleRedirects:=True; myIH.Request.UserAgent:='Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)';
// myIH.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon)';
postList.Add('__EVENTTARGET=');
postList.Add('__VIEWSTATE=/wEPDwUJLTI5NjAzODk2ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQULY2hrUmVtZW1iZXKHW0DW4nQrSrBHBomKrt3/MjtBLA==');
postList.Add('__EVENTVALIDATION=/wEWBQKE2u7lCQLyj/OQAgK3jsrkBALR55GJDgKC3IeGDO8x1Jd0k/hBY1a/6Yl9fTpP16ti');
postList.Add('input1=@@@@');
postList.Add('input2=@@@@');
postList.Add('chkRemember=');
postList.Add('btnLogin=登 錄');
myIH.Post('http://passport.cnblogs.com/login.aspx',postList,Response);
finally
Memo1.Lines.Text := Utf8ToAnsi(Response.DataString);
Response.Free;
postList.Free;
end;
end;
用twebbrowser好了