+ -
当前位置:首页 → 问答吧 → idhttp登录网页的问题

idhttp登录网页的问题

时间:2011-08-20

来源:互联网

procedure TForm1.Button1Click(Sender: TObject);
var
postList: TStrings;
Response: TStringStream;

begin;
  Response := TStringStream.Create('');
  postList := TStringList.Create;
  try
  IdHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon)';
  postList.Add('id=admin');
  postList.Add('ps=1');
  IdHTTP1.Post('http://www.zhezhisd.cn/admin_in.asp',postList,Response);
  finally
  Memo1.Lines.Text := Response.DataString;
  Response.Free;
  postList.Free;
  end;

end;
我写成这样就可以:
IdHTTP1.Post('http://www.zhezhisd.cn/admin_in.asp/?id=admin&ps=1',postList,Response);
而象上面那样提交就不成功。请问是为什么?post的第二个参数不是用来提交一些参数的吗?

作者: PANTI   发布时间: 2011-08-20

后面参数的字符串是id=admin&ps=1,你Add参数的时候这个 & 怎么不见了?

作者: omagic   发布时间: 2011-08-20

热门下载

更多