0
点赞
收藏
分享

微信扫一扫

linux和WIN系统区别

hoohack 2022-11-29 阅读 105
  1. ​string targetUrl =​​​​"https://ip.hahado.cn/ip";​
  2. ​string proxyIp =​​​​"219.151.125.106";​
  3. ​string proxyPort =​​​​"31615";​
  4. ​string authKey =​​​​"895314XY";​
  5. ​string password =​​​​"24D6YB309ZCB";​
  6. ​WebProxy proxy =​​​​new​​​​WebProxy(string.Format("{0}:{1}", proxyIp, proxyPort),​​​​true);​
  7. ​proxy.Credentials​​​​=​​​​new​​​​NetworkCredential(authKey, password);​
  8. ​ServicePointManager.Expect100Continue​​​​=​​​​false;​
  9. ​var request =​​​​WebRequest.Create(targetUrl)​​​​as​​​​HttpWebRequest;​
  10. ​request.AllowAutoRedirect​​​​=​​​​true;​
  11. ​request.KeepAlive​​​​=​​​​true;​
  12. ​request.Method​​​​=​​​​"GET";​
  13. ​request.Proxy​​​​= proxy;​
  14. ​request.Timeout​​​​=​​​​10000;​
  15. ​request.ServicePoint.ConnectionLimit​​​​=​​​​16;​
  16. ​using​​​​(var resp = request.GetResponse()​​​​as​​​​HttpWebResponse)​
  17. ​using​​​​(var reader =​​​​new​​​​StreamReader(resp.GetResponseStream(),​​​​Encoding.UTF8)){​
  18. ​string htmlStr = reader.ReadToEnd();​
  19. ​}​

linux和WIN系统区别_html

举报

相关推荐

0 条评论