我想检查程序是否安装在用户的系统上,我已经使用注册表进行了操作,并且程序运行良好
但是现在我要检查版本号
return uninstallKey.GetSubKeyNames()
.Select(installedSoftwareString => uninstallKey.OpenSubKey(installedSoftwareString))
.Select(installedSoftwareKey => installedSoftwareKey.GetValue("DisplayName") as string)
.Any(installedSoftwareName => installedSoftwareName != null && installedSoftwareName.Contains(softwareName));
为此,我添加了以下代码
.Select(installedSoftwareKey => installedSoftwareKey.GetValue("DisplayVersion") as string)
但是它给出了一个错误
字符串不包含GetValue的定义...