|
就在昨天,在苏老大的指点下,完成了猫扑的正确登陆,但是我想带着COOKIE直接打开猫扑某个网页,为何又退出了登陆呢?
是我的cookie保存不对吗?
string Cookies = "";
string[] tem;
HttpHelper http = new HttpHelper();
HttpResult result = null;
private void button1_Click_1(object sender, EventArgs e)
{
//登陆
HttpItem item = new HttpItem()
{
URL = "http://login.hi.mop.com/Login.do",
Encoding = null,
ContentType = "application/x-www-form-urlencoded",
Method = " OST",
Cookie = "",
Postdata = "nickname=%E9%9B%A8%E9%AD%82%E5%A4%A9%E9%9B%AA&password=asd123258&origURL=http%3A%2F%2Fhi.mop.com%2FSysHome.do&loginregFrom=index&ss=10101",
};
result = http.GetHtml(item);
Cookies += result.Cookie;
item = new HttpItem()
{
URL = "http://home.hi.mop.com/Home.do?ss=10106",
Encoding = null,
ContentType = "application/x-www-form-urlencoded",
Method = "GET",
Cookie = Cookies,
// Referer="http://login.hi.mop.com/Login.do"
};
result = http.GetHtml(item);
Cookies += result.Cookie;
//此时已经显示登陆正常了,但打开某个网页为何又退出登陆了呢?    
item = new HttpItem()
{
URL = "http://tt.mop.com/read_14633343_1_0.html",
Encoding = null,
ContentType = "application/x-www-form-urlencoded",
Method = "GET",
Cookie = Cookies,
};
result = http.GetHtml(item);
Cookies += result.Cookie;
webBrowser1.DocumentText = result.Html;
} |
|