Tag: httpwebrequest webproxy

C#HttpWebRequest请求通过代理

我试图让我的程序通过代理工作,但它不想(System.Net.WebException:操作已经超时)。 没有代理一切都很好 这是一个代码: string proxy = “154.46.33.157”; int port = 8080; ASCIIEncoding encoding = new ASCIIEncoding(); string postData = “email=” + email + “&pass=” + pass; byte[] data = encoding.GetBytes(postData); WebProxy myproxy = new WebProxy(proxy, port); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(“SITE”); WebHeaderCollection myWebHeaderCollection = request.Headers; request.CookieContainer = sCookie; request.Method = “POST”; request.Proxy = myproxy; request.ContentType = […]