【问题标题】:Detect the installed version of Windows Media Player using C# [duplicate]使用 C# 检测已安装的 Windows Media Player 版本 [重复]
【发布时间】:2013-10-04 12:53:02
【问题描述】:

我有一个 C# 应用程序,我需要检测已安装的 Windows Media Player 版本(我需要知道它是否高于 10)。任何人都知道我该如何解决它?非常感谢!

【问题讨论】:

标签: c# .net winforms media-player


【解决方案1】:

查看键 HKLM\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95} 下的 IsInstalled 值。安装时为 1,否则为 0。

Detecting Windows Media Player from an Application.

【讨论】:

  • 谢谢 这很好用。但根据您的链接,我使用 {6BF52A52-394A-11d3-B153-00C04F79FAA6} 来检查 WMP ver7 或更高版本。
【解决方案2】:

您必须通过 c# 使用注册表来获取详细信息 系统上安装的每个软件在“SOFTWARE”下的“HKEY_LOCAL_MACHINE”中都有注册表项

所以我们进去并在 Microsoft 文件夹中搜索 MediaPlayer

我们有一个名为 PlayerUpgrade 的文件夹,里面有密钥 PlayerVersion,其中安装了媒体播放器的版本。 p>

下面是代码

RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\MediaPlayer\\PlayerUpgrade", false);
string version = (string) myKey.GetValue("PlayerVersion");

您将获得类似“11,0,6002,18111”的值。表示版本 11

【讨论】:

    【解决方案3】:

    您也可以使用 .Net 来读取文件版本。示例:

    FileVersionInfo wmpInfo = FileVersionInfo.GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Windows Media Player", "wmplayer.exe"));
    if (wmpInfo.FileMajorPart > 10)
    {
        //Do something
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多