悬赏园豆:30
[已关闭问题]
using System; <BR>using Microsoft.Win32; <BR>using System.Diagnostics; <BR><BR>public class ChangProxy <BR>{ <BR> public static void Main(string[] args) <BR> { <BR><BR> int Proxy_Enabled; <BR> RegistryKey rkey = Registry.CurrentUser; <BR> RegistryKey software = rkey.OpenSubKey("Software"); <BR> RegistryKey microsoft = software.OpenSubKey("Microsoft"); <BR> RegistryKey windows = microsoft.OpenSubKey("Windows"); <BR> RegistryKey currentversion = windows.OpenSubKey("CurrentVersion"); <BR> RegistryKey internetsettings = currentversion.OpenSubKey("Internet Settings", true); <BR> Proxy_Enabled = Convert.ToInt32(internetsettings.GetValue("ProxyEnable")); <BR> if (Proxy_Enabled != 1) <BR> { <BR> internetsettings.SetValue("ProxyEnable", 1); <BR> Microsoft.VisualBasic.Interaction.Beep(); <BR> } <BR> else <BR> internetsettings.SetValue("ProxyEnable", 0); <BR> } <BR>} <BR><BR>以上为代码,通过读取注册表中的ProxyEnable的键值判断IE是否使用代理,如果使用了代理则取消代理,如果未使用代理则加上代理设置. <BR><FONT color=#ff0000 size=3>问题是,每次通过修改注册表键值更改IE代理设置状态后都必须重启IE才能使代理设置生效. <BR>请问各位达人,如何做到无需重启IE即可使IE代理设置变更生效?</FONT> <BR>谢谢.小弟在线等.
eecc
|
初学一级
|
园豆:
41
提问于:2008-06-04 19:52