Post的时候遇到如下错误,
顺便问个新手问题,对一个网站进行Post的话,哪些字段是必要字段啊
代码如下:
[C#] 纯文本查看 复制代码 private void button1_Click(object sender, EventArgs e)
{
string username = this.textBox1.Text;
string password = this.textBox2.Text;
HttpHelper helper = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.sufeinet.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1",
Method = "post",
Cookie = "",
UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36",
Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
ContentType = "application/x-www-form-urlencoded",
//Referer = "http://www.sufeinet.com/",
Postdata = "fastloginfield=username&username=" + URLEncode(username) + "&password=" + URLEncode(password) + "&quickforward=yes&handlekey=ls"
};
HttpResult result = helper.GetHtml(item);
string cookie = result.Cookie;
string html = result.Html;
this.richTextBox1.Text = html;
}
|