Is there any way i can skip/catch all proxy exceptions?
And also maybe put a time-out so the program wont get stuck in-between
webProxy = new WebProxy("" + prox + "");
webProxy.Credentials = CredentialCache.DefaultCredentials;
wr.Proxy = webProxy;
I’ve added
catch (Exception ex)
{
// Do nothing or log
var exceptio = ex.ToString();
richTextBox1.Text = exceptio;
}
how can i put a time-out on it?
As suggested you need to enclose the executing code in a
try/catchblock.You can fiddle around with debugger Exception handling under Debug/Exceptions… (in Visual Studio) but regardless, any non-handled exception will always trigger the debugger to break.
More on debugging and exceptions can be found here
Regarding time-out, you put it on the
WebRequestobject, not on the proxy, like so:Read more on timeout here.