-
string targetUrl ="https://ip.hahado.cn/ip"; -
string proxyIp ="219.151.125.106"; -
string proxyPort ="31615"; -
string authKey ="895314XY"; -
string password ="24D6YB309ZCB"; -
WebProxy proxy =newWebProxy(string.Format("{0}:{1}", proxyIp, proxyPort),true); -
proxy.Credentials=newNetworkCredential(authKey, password); -
ServicePointManager.Expect100Continue=false; -
var request =WebRequest.Create(targetUrl)asHttpWebRequest; -
request.AllowAutoRedirect=true; -
request.KeepAlive=true; -
request.Method="GET"; -
request.Proxy= proxy; -
request.Timeout=10000; -
request.ServicePoint.ConnectionLimit=16; -
using(var resp = request.GetResponse()asHttpWebResponse) -
using(var reader =newStreamReader(resp.GetResponseStream(),Encoding.UTF8)){ -
string htmlStr = reader.ReadToEnd(); -
}










