摘要:除了用户名,密码外,还需要cookie中的BAIDUID,H_PS_PSSID和一个token;最后登陆成功后返回一个BDUSS。以后用BAIDUID,H_PS_PSSID和BDUSS即可。
阅读全文
摘要:using System.Net;IPAddress ad1=IPAddress.Parse("192.168.1.1"); //ip为192.168.1.1的地址IPAddress ad2=IPAddress.Loopback; //127.0.0.1IPAddress ad3=IPAddre...
阅读全文
摘要:1 CookieContainer cookie = new CookieContainer(); 2 private string HttpPost(string Url, string postDataStr) 3 { 4 HttpWebRequest ...
阅读全文
摘要:public string HttpGet(string Url, string postDataStr) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url + (postDataSt...
阅读全文
摘要:这是一个下载网页非常简单,但是非常有限的方法.1 using System.Net;2 3 var wc = new WebClient(); //新建一个WebClient对象 wc4 string href = wz; //网址为字符串 wz5 var html = wc.DownloadString(href); //html 就是wz的网页内容得到这个html就可以做一些自己想做的事情.此方法检索指定的资源。下载该资源之后,此方法使用在Encoding属性中指定的编码将该资源转换为String。WebClient client = new WebClie...
阅读全文