我用XE4的idhttp來post登入繁體新浪博客, 但是mmoResultSource.Text沒有任何回傳代碼,我看是登入失敗了,有誰能幫忙看看是什么原因,感激感謝呀!
procedure TForm1.btnLoginClick(Sender: TObject);
var
PostData:TStringList;
postStream : TStringStream;
i : Integer;
strResultSourceCode , LoginStatus : String;
match: TMatch;
group: TGroup;
groups: TGroupCollection;
begin
idhttp.Request.Accept := 'text/html, application/xhtml+xml, */*';
idhttp.Request.AcceptEncoding := 'gzip, deflate';
idhttp.Request.AcceptLanguage := 'zh-TW';
idhttp.Request.CacheControl := 'no-cache';
idhttp.Request.Connection := 'Keep-Alive';
idHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
idhttp.Request.Host := 'mysinablog.com';
idhttp.Request.Referer := 'http://mysinablog.com/admin.php';
idhttp.Request.UserAgent := 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)';
postStream := TStringStream.Create('userName='+ UTF8Encode(edtUserName.Text) +'&userPassword='+ UTF8Encode(edtPassword.Text) +'&op=Login&next=');
mmoResultSource.Text := idhttp.Post('http://mysinablog.com/admin.php',postStream);
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/132861.html
標籤:網絡通信/分布式開發
