|
发表于 2013-3-5 19:09:44
|
显示全部楼层
admin 发表于 2013-3-4 20:16
好的这是网址http://www.sufeinet.com/thread-1072-1-1.html
飞哥,登录163的这个例子需要人工拼接URL,我把截取到的PostData存入HttpItem.Postdata中不好使,这个HttpItem.Postdata什么情况下可以直接赋值呢,下面是代码,麻烦飞哥看一下
[code=csharp] private void btnEnter_Click(object sender, EventArgs e)
{
HttpItem item = new HttpItem()
{
//URL = "https://reg.163.com/logins.jsp?url=&product=&savelogin=&outfoxer=&domains=" +
//"&syscheckcode=034715eb7e1f16cd332e41f95e3303204ceadd7e&username="
//+ txtUserName.Text.Trim() + "&password="
//+ txtPwd.Text.Trim() + "&Submit=",
URL = "https://reg.163.com/logins.jsp",
Postdata = "url=&product=&savelogin=&outfoxer=&domains="
+ "&syscheckcode=034715eb7e1f16cd332e41f95e3303204ceadd7e&username="
+ txtUserName.Text.Trim() + "&password="
+ txtPwd.Text.Trim() + "&Submit=",
Referer = "https://reg.163.com/logins.jsp",
Method = "post",
};
HttpHelper http = new HttpHelper();
string html = http.GetHtml(item);
string cookie = item.Cookie;
lblMessages.Text = "cookie:" + cookie + "\r\n\r\n";
item.URL = "http://reg.163.com/Main.jsp";
lblMessages.Text += http.GetHtml(item);
}[/code] |
|