IWMPErrorItem::errorDescription 属性

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

errorDescription 属性获取错误的说明。

语法

public System.String errorDescription {get; set;}

Public ReadOnly Property errorDescription As System.String

属性值

作为错误说明的 System.String

备注

如果选择显示自定义错误消息,则应将 IWMPSettings.enableErrorDialogs 设置为 false

示例

以下示例在 Error 事件处理程序中使用 errorDescription 向用户显示错误说明。 AxWMPLib.AxWindowsMediaPlayer 对象由名为 player 的变量表示。

private void player_ErrorEvent_errorDescription(object sender, System.EventArgs e)
{
    // Get the error description for the first error item.
    string errDesc = player.Error.get_Item(0).errorDescription;

    // Display the error description.
    System.Windows.Forms.MessageBox.Show("Error: " + errDesc);
}

Public Sub player_ErrorEvent_errorDescription(ByVal sender As Object, ByVal e As System.EventArgs) Handles player.ErrorEvent

    ' Get the error description for the first error item.
    Dim errDesc As String = player.Error.Item(0).errorDescription

    ' Display the error description.
    System.Windows.Forms.MessageBox.Show("Error: " + errDesc)

End Sub

要求

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

另请参阅

IWMPErrorItem 接口 (VB 和 C#)

IWMPSettings.enableErrorDialogs (VB 和 C#)