string path = @"\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer";
                                RegistryKey key = Registry.CurrentUser.OpenSubKey(path,true); 
但是注册表里有这个路径.. 怎么读取不到..  

解决方案 »

  1.   

    string path = @"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer";
    这样写多了个"\"
                    
      

  2.   

    运行出来是Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer这样
      

  3.   

    string path = @"Software/Microsoft/Windows/CurrentVersion/Policies/Explorer";
      

  4.   

       Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\PageSetup\\", true);
    获取到key 之后你要获取keyvalue
                _bottom = string.IsNullOrEmpty(rk.GetValue("margin_bottom").ToString()) ? "0" : rk.GetValue("margin_bottom").ToString();
      

  5.   


    这样没用,key路径不存在,我怎么去获取他的子项值嘛!但是这个路径在注册表里是存在的!
      

  6.   

    我现在是要在这个路径下创建一个DWord,但是到这个路径这里就不存在了,无法进行下面的操作了呀
      

  7.   

    Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", true);
    获取到key 之后你要获取keyvalue
       _bottom = string.IsNullOrEmpty(rk.GetValue("NoLowDiskSpaceChecks").ToString()) ? "0" : rk.GetValue("margin_bottom").ToString();
      

  8.   

    Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", true);之后创建
      

  9.   


    怎么测试? 我是以administrator账户登录的,这应该有操作注册表的权限吧