这是注册表中密钥的路径:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\appname.EXE\shell\open\command
有一个关键
默认类型:REG_SZ,包含以下内容:
"D:\programs\entry1\entry 2\appname.EXE" "%1"
如何在字符串中输入“D:\ programs \ entry1 \ entry 2 \ appname.EXE”?我无法用通常的方法做到这一点,我想这是由reg_sz类型引起的?
答案 0 :(得分:0)
REG_SZ
包含字符串值,因此您应该能够获得(默认) - 值,如下所示:
Dim regKey As Microsoft.Win32.RegistryKey
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Classes\Applications\appname.EXE\shell\open\command", False)
Dim s As String = regKey.GetValue("", "<value not found>").ToString
或者如果需要其他值,则只需更改以下行:
Dim s As String = regKey.GetValue("anothervalue", "<value not found>").ToString