不
不不
Unregistered / Unconfirmed
GUEST, unregistred user!
我使用IdHttp控件,模拟登陆csdn,代码如下
Edit1.Text := 'http://www.csdn.net/index.htm';
Memo1.Text := 'name=myname&pass=mypass&type=1';
IdHTTP1.Request.UserAgent := 'test';
IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
IdHttp1.Request.ContentLength := Length(Memo1.Text);
Rsp := TStringStream.Create('');
IdHttp1.Request.ContentType := 'POST';
IdHttp1.Request.URL := Edit1.Text;
IdHttp1.Post(Edit1.Text, Memo1.Lines, Rsp);
Memo2.Text := Rsp.DataString;
Edit1.Text := 'http://www.csdn.net/index.htm';
Memo1.Text := 'name=myname&pass=mypass&type=1';
IdHTTP1.Request.UserAgent := 'test';
IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
IdHttp1.Request.ContentLength := Length(Memo1.Text);
Rsp := TStringStream.Create('');
IdHttp1.Request.ContentType := 'POST';
IdHttp1.Request.URL := Edit1.Text;
IdHttp1.Post(Edit1.Text, Memo1.Lines, Rsp);
Memo2.Text := Rsp.DataString;