读注册表即可
public void GetProxySetting()
{
int Proxy_Enabled;
//track to the SubKey
RegistryKey rkey = Registry.CurrentUser;
RegistryKey software = rkey.OpenSubKey("Software");
RegistryKey microsoft = software.OpenSubKey("Microsoft");
RegistryKey windows = microsoft.OpenSubKey("Windows");
RegistryKey currentversion = windows.OpenSubKey("CurrentVersion");
RegistryKey internetsettings = currentversion.OpenSubKey("Internet Settings");
Proxy_Enabled = Convert.ToInt32(internetsettings.GetValue("ProxyEnable"));
//if ProxyEnable is true
if (Proxy_Enabled!=0)
{
string ProxySettings=internetsettings.GetValue("ProxyServer").ToString();
int i = ProxySettings.IndexOf(":");
int j = ProxySettings.Length;
textBox_AddressNow.Text=ProxySettings.Remove(i,j-i);
textBox_PortNow.Text=ProxySettings.Remove(0,i+1);
}
}