ฉันมีปัญหากับ HttpWebRequest.getResponse() try catch ของฉันไม่จับการตอบสนองของฉัน :/. นี่คือโค้ด: พร็อกซีและพอร์ตใช้งานได้ดี
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