|
楼主 |
发表于 2012-11-2 16:03:37
|
显示全部楼层
-
- string UserName = User.Name;
- string Password = User.Password;
- var HttpHelper=new FunctionServices.httphelper();
- var objHttpItem = new FunctionServices.HttpItem();
- objHttpItem.URL = "https://www.kuaipan.cn/account_login.htm";
- objHttpItem.Encoding = "UTF-8";
- objHttpItem.Method = "GET";
- objHttpItem.Referer = "";
- objHttpItem.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1";
- objHttpItem.ContentType = "text/html";
- objHttpItem.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
- string html1 = HttpHelper.GetHtml(objHttpItem);
- ////取得登录后的Cookie
- string cookie = HttpHelper.cookie;
- var httpItem = new FunctionServices.HttpItem();
- httpItem.URL = @"https://www.kuaipan.cn/index.php?ac=account&op=login";
- httpItem.Encoding = "UTF-8";
- httpItem.Postdata = string.Format("isajax=yes&username={0}&userpwd={1}", UserName, Password);
- httpItem.Referer = @"https://www.kuaipan.cn/account_login.htm";
- httpItem.Method = "POST";
- httpItem.ContentType = "application/x-www-form-urlencoded";
- //httpItem.Accept = "application/json, text/javascript, */*";
- httpItem.Cookie = cookie;
- string html2 = HttpHelper.GetHtml(httpItem);
- ////取得登录后的Cookie
- string cookie1 = HttpHelper.cookie;
复制代码 实在是不行,请指教
COOKIE是取到了的,登陆不了 |
|