T
Tim Regan
Hi All,
I'm writing an app using WebRequest in csharp. I need the app to respond to
the host PC moving from one network to another, e.g. taking a laptop home
after work. Currently the WebRequest.Proxy is always picked up from the work
network settings, so that the GetResponse method throws a WebException when
the proxy is unreachable. But IE works fine across the two networks.
I've two questions.
1) Where is WebRequest getting the default proxy information from? I'd
assumed that it picked it up from IE's settings, but that doesn't explain
why IE makes the transition from work to home without problem while
WebRequest fails.
2) How do I test the reachability of the WebRequest.Proxy before calling
GetResponse? If I could test it first I could replace it with
GlobalProxySelection.GetEmptyWebProxy for the home network.
Cheers,
Tim.
I'm writing an app using WebRequest in csharp. I need the app to respond to
the host PC moving from one network to another, e.g. taking a laptop home
after work. Currently the WebRequest.Proxy is always picked up from the work
network settings, so that the GetResponse method throws a WebException when
the proxy is unreachable. But IE works fine across the two networks.
I've two questions.
1) Where is WebRequest getting the default proxy information from? I'd
assumed that it picked it up from IE's settings, but that doesn't explain
why IE makes the transition from work to home without problem while
WebRequest fails.
2) How do I test the reachability of the WebRequest.Proxy before calling
GetResponse? If I could test it first I could replace it with
GlobalProxySelection.GetEmptyWebProxy for the home network.
Cheers,
Tim.