|
[code=csharp] HttpHelper http = new HttpHelper();
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
HttpItem item = new HttpItem()
{
URL = @"https://211.156.219.88/itplat/login.action",
Method = "post",
CerPath = @"H:\Users\zzs\Documents\证书\4531294.cer",
Postdata = "orgcode='80651415'&opercode='100001'&operpwd='xxx'",
Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20100101 Firefox/22.0",
ContentType = "multipart/form-data",//; boundary="+ boundary,
Allowautoredirect = true,
KeepAlive=true
};
item.Header.Add("Accept-Encoding", "gzip, deflate");
HttpResult result = http.GetHtml(item);
textBox1.Text = result.Html;
[/code]
上面的代码,报404错误,如果把ContentType那一行注释掉,返回的是“机构号与操作员号不能为空”,就是没有成功post数据。但实际我有post的( Postdata = "orgcode='80651415'&opercode='100001'&operpwd='xxx'",)。是我哪里错了吗?求各位大大指点,多谢了! |
|