我写了以下代码:
RegistryKey _Key = Registry.ClassesRoot.OpenSubKey("SystemFileAssociations", true);
foreach (String s in names)
{
System.Windows.Forms.MessageBox.Show("Done.===================" + s);
}
_Key.Close();
打印一个等于的条目.txt
但是,当我这样做时,即尝试/HKCR/SFA/.txt
像这样访问密钥:
RegistryKey rootKey = Registry.ClassesRoot.OpenSubKey("SystemFileAssociations//.txt", true);
rootKey.Close();
我收到以下错误:
SystemNullReferenceException: Object reference not set to an instance of an object