AxWindowsMediaPlayer.versionInfo 属性

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

versionInfo 属性获取一个值,该值指定Windows 媒体播放器的版本。

此属性为只读。

语法

public System.String versionInfo {get;}

Public ReadOnly Property versionInfo As System.String

属性值

一个 System.String,它是以下格式的版本信息:“X.0.0.YYYY“,其中 X 表示主版本号,YYYY 表示内部版本号。

示例

以下示例创建一个按钮,单击该按钮时,会显示一个消息框,其中包含Windows 媒体播放器的版本信息。 AxWMPLib.AxWindowsMediaPlayer 对象由名为 player 的变量表示。

private void showVersion_Click(object sender, System.EventArgs e)
{
    // Build the message containing the version info. 
    string message = ("Windows Media Player Version: " + player.versionInfo);

    // Display the message. 
    System.Windows.Forms.MessageBox.Show(message);
}

Public Sub showVersion_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles showVersion.Click

    ' Build the message containing the version info. 
    Dim message As String = ("Windows Media Player Version: " + player.versionInfo)

    ' Display the message. 
    System.Windows.Forms.MessageBox.Show(message)

End Sub

要求

要求
版本
Windows 媒体播放器 9 系列或更高版本
命名空间
AxWMPLib
程序集
AxInterop.WMPLib.dll (AxInterop.WMPLib.dll.dll)

另请参阅

AxWindowsMediaPlayer 对象 (VB 和 C#)