首页 新闻 会员 周边 捐助

c# 实现登录博客园代码

0
悬赏园豆:5 [已解决问题] 解决于 2017-06-01 09:38

通过c#实现登录博客园,在线等,c#如何传递cookie值到url

lazycat_1的主页 lazycat_1 | 初学一级 | 园豆:188
提问于:2016-06-27 13:11
< >
分享
最佳答案
0

放到 Headers 里试试(滑稽

收获园豆:5
长蘑菇星人 | 小虾三级 |园豆:1832 | 2016-06-27 13:56

HttpWebRequest httpRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpRequest.CookieContainer = cookie;
httpRequest.Referer = url;
httpRequest.UserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36";
httpRequest.Accept = "application/json, text/javascript, */*; q=0.01";
httpRequest.ContentType = "application/json; charset=UTF-8";
httpRequest.Method = "GET";
httpRequest.Referer = "http://passport.cnblogs.com/user/signin?ReturnUrl=http%3A%2F%2Fwww.cnblogs.com%2F";

我是这样写的

lazycat_1 | 园豆:188 (初学一级) | 2016-06-27 14:02

@lazycat_1: GET方法么(逃

长蘑菇星人 | 园豆:1832 (小虾三级) | 2016-06-27 14:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册