我对 HttpWebRequest.getResponse() 有疑问。我的尝试捕捉没有捕捉到我的回应:/。这是代码: 代理和端口都很好
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://www.google.com/");
req.Proxy = new WebProxy(Host, Port);
req.Method = "GET";
req.KeepAlive = false;
req.Timeout = 10000;
req.ContentType = "text/xml";
try
{
using (WebResponse response = req.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
}
}
}
catch (WebException) { }
catch (Exception){ }
仍然出现错误窗口:http: //i.imgur.com/yRPB2NV.jpg