using Microsoft.Win32;
RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(@"SOFTWARE/EKING");
string installPath = (string)registryKey.GetValue(null);
installPath += @"/A.mdb";
注册表文件:reg.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT/SOFTWARE/EKING]
"FILEPATH"="D:/ABC"
博客展示了在Windows环境下,使用Microsoft.Win32命名空间从注册表中获取安装路径的代码示例。通过RegistryKey打开指定注册表项,获取对应的值并拼接路径。还给出了注册表文件的内容。
5154

被折叠的 条评论
为什么被折叠?



