ソースを参照

修复注册表空值删除异常

yuzhengyang 8 年 前
コミット
1af7c5a629
1 ファイル変更1 行追加1 行削除
  1. 1 1
      Fork.Net/Y.Utils.Net20/ComputerUtils/RegisterTool.cs

+ 1 - 1
Fork.Net/Y.Utils.Net20/ComputerUtils/RegisterTool.cs

@@ -50,7 +50,7 @@ namespace Y.Utils.Net20.ComputerUtils
             try
             {
                 RegistryKey RKey = Registry.LocalMachine.OpenSubKey(key, true);
-                if (RKey != null)
+                if (RKey != null && RKey.GetValue(name) != null)
                     RKey.DeleteValue(name);
                 return true;
             }