this.MyRegistryHive = RegistryHive.CurrentUser;//枚举类型
this.MyRegistryKey = RegistryKey.OpenRemoteBaseKey(this.MyRegistryHive,"");//打开远程计算机的注册表
this.MyRegistryKey.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main",true);//以可读写方式打开
string GetInfoStart = (string)this.MyRegistryKey.GetValue("Start Page");//得到初始值
this.TxtRemoteComputer.Text = GetInfoStart;
this.MyRegistryKey.SetValue("Start Page","http://www.163.com");//设置初始页
GetInfoStart = (string)this.MyRegistryKey.GetValue("Start Page");//得到初始值
MessageBox.Show(GetInfoStart);
this.LocalRegistryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main",true);
MessageBox.Show(this.LocalRegistryKey.GetValue("Start Page").ToString());//以当地方式打开
为什么我用OpenRemoteBaseKey打开本地计算机时;
this.TxtRemoteComputer.Text时显示:http://www.163.com
MessageBox.show()显示:http://www.163.com
但是没有改变我的主页,不知道为什么,,
而我用本地访问时,我的主页还是没有被改变,
我可以用本地访问改变自己的主页,
但是为什么不能用OpenRemoteBaseKey这个来改呢??
分数不高,,但是还是希望高手能解决一下,,艾,没办法,实在没分 !!