如何确定 x64 计算机上的 Silverlight 版本?

发布于 2024-10-22 00:31:37 字数 251 浏览 3 评论 0原文

根据最新的silverlight部署指南,我可以确定安装的是哪个版本的silverlight

-查询:“HKLM\Software\Microsoft\Silverlight\Version”注册表项

这在我的 32 位开发计算机上效果很好。但在一些 64 位计算机上,HKLM\Software\Microsoft\Silverlight 并不存在。

它在 x64 机器上的哪里?

According to the latest silverlight deployment guide, I can determine what version of silverlight is installed by

-Querying the: “HKLM\Software\Microsoft\Silverlight\Version” registry key

This works great on my 32 bit dev machine. But on a couple of 64 bit machines, HKLM\Software\Microsoft\Silverlight doesn't exist.

Where is it on x64 machines?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

〃安静 2024-10-29 00:31:37

查看 HKLM\Software\Wow6432Node,这是 32 位程序可以看到的注册表项的主页。

Look in HKLM\Software\Wow6432Node, the home for registry keys that 32-bit programs can see.

祁梦 2024-10-29 00:31:37

搜索我的注册表,我发现了这个:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight

任何人都可以确认这是一个安全的地方吗?

Searching through my registry, I found this:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Silverlight

Can anyone confirm that this is a safe place to look?

对不⑦ 2024-10-29 00:31:37

我知道这个问题已经得到解答,但您可以在 .Net 4 中使用“RegistryKey”。这允许您的 32 位程序访问 64 位注册表,就像通常在 64 位计算机上查看的那样。代码:

using Microsoft.Win32;

RegistryKey registryBase = Registry.LocalMachine; // This would give you the standard Registry if you were using your own machine. Not needed for this example.

registryBase = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); // This will allow your 32 bit program to view the 64 bit registry.

RegistryKey getKey = registryBase.OpenSubKey("HKLM\Software\Microsoft\Silverlight\Version", true); // Set to true or false to allow write permissions.

getKey.SetValue("VersionKey", "0", RegistryValueKind.DWord); //Allow's you to edit the exact key type. Just change DWord etc...

希望这有用。我使用它是因为有时您无法查看“Wow6432Node”中所需的所有密钥。

I know this has been answered but you can use 'RegistryKey' with .Net 4. This allow's your 32 bit program to access the 64 bit registry as it would be normally viewed on your 64 bit machine. The code:

using Microsoft.Win32;

RegistryKey registryBase = Registry.LocalMachine; // This would give you the standard Registry if you were using your own machine. Not needed for this example.

registryBase = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); // This will allow your 32 bit program to view the 64 bit registry.

RegistryKey getKey = registryBase.OpenSubKey("HKLM\Software\Microsoft\Silverlight\Version", true); // Set to true or false to allow write permissions.

getKey.SetValue("VersionKey", "0", RegistryValueKind.DWord); //Allow's you to edit the exact key type. Just change DWord etc...

Hope this is useful. I use this as sometimes you cannot view all keys required in 'Wow6432Node'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文