[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://passport.21cnjy.com/login?jump_url=http%3A%2F%2Fwww.21cnjy.com%2Fucp.php",//URL 必需项
Method = "POST",
Cookie = "HqNL_ef65_saltkey=I69Y8w62; HqNL_ef65_lastvisit=1552233177; HqNL_ef65_sid=uDf6gn; HqNL_ef65_lastact=1552236777%09ucp.php%09; HqNL_ef65_saltkey=I69Y8w62; HqNL_ef65_lastvisit=1552233177; HqNL_ef65_sid=uDf6gn; HqNL_ef65_lastact=1552236777%09ucp.php%09;PHPSESSID=vnioj88krlc7or9oma2n5ha2t3; _csrf=f9e631ecf5ef752358698e53dd2e35688db2271bf47562b2efff1c3c36342462a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22nSgHKJNL0GD6OwWdRY2aBWj8AjTScsrp%22%3B%7D",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
Referer ="https://passport.21cnjy.com/login?jump_url=http%3A%2F%2Fwww.21cnjy.com%2Fucp.php",//来源URL 可选
Postdata = "_csrf=AQaYQAxjgDm8DuOg4UaRyW2vQKW-38sxdUgy9h2TRCBvVf8IRynOdYxJp5auMcatP_ZyxPyIoQk0ImalfuA2UA==&LoginForm[username]=3392&LoginForm[password]=668866
LoginForm[rememberMe]: 0",//Post数据 可选项GET时不需要写
ResultType = ResultType.String,//返回数据类型,是Byte还是String
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
以上代码一直都无法获取登录后的cookie,返回的还是未登录
我的QQ251123458,可以做的联系我,我付钱
|