System.Net.WebProxy in .NET Client
Posted
by NealWalters
on Stack Overflow
See other posts from Stack Overflow
or by NealWalters
Published on 2010-03-23T16:52:36Z
Indexed on
2010/03/23
16:53 UTC
Read the original article
Hit count: 424
proxy
|webservice
I don't yet have a good understanding of how the network is set up at my current client, but here is my issue. The vendor has a normal URL, but it might be a leased line.
I have a .NET program that calls an external .asmx service. If I go to IE, Connections, LAN Settings, and uncheck "Automatic detect settings" and uncheck "Use Automatic Configuration Sript", then the .NET program runs and access the web service fine.
But then, to access internet again from the browser, I have to re-check the two boxes, and so on throughout the day while we are testing and browsing.
I'm hoping to put some code like this in the .NET program to avoid us having to constantly change:
if (chkUseProxy.Checked)
{
myclient.Proxy = new System.Net.WebProxy("");
}
I tried null and empty string and so far not able to connect without errors. Is this possible, and if so, what might be the correct parms for the constructor? Or are there other objects or properties that would need to be set?
Thanks,
Neal Walters
© Stack Overflow or respective owner