C# 2008 SP1
I am using the code to detect if a proxy has been set under \"Internet Options\". If there is a proxy then I will set this in my webclient.
So I
Check out the System.Net.Configuration.ProxyElement class. That may have info you're looking for.
What you describe works, you can also look in the registry.
Here's a powershell script I wrote to check out the proxy:
function get-proxy
{
$path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$reg = get-itemproperty $path
return $reg
}