//打開注冊表鍵
Microsoft.Win32.RegistryKey rk=Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings",true);
//設(shè)置代理可用
rk.SetValue("ProxyEnable",1);
//設(shè)置代理IP和端口
rk.SetValue("ProxyServer","192.168.0.1:80");
rk.Close();