ExceptionRoutedEventArgs.ErrorException 屬性

定義

取得造成錯誤狀況的例外狀況。

public:
 property Exception ^ ErrorException { Exception ^ get(); };
public Exception ErrorException { get; }
member this.ErrorException : Exception
Public ReadOnly Property ErrorException As Exception

屬性值

Exception

詳述特定錯誤狀況的例外狀況。

例外狀況

嘗試存取媒體檔案遭拒。

找不到媒體檔案。

所有安裝的轉碼器皆不支援此媒體檔案格式。

-或-

檔案格式無法辨識。

未偵測到 Windows Media Player 10 或更新版本。

-或-

視訊資源不足而無法執行媒體播放。

顯示 COM 錯誤碼。

範例

下列範例會建立 的 ExceptionRoutedEventArgs 簡單事件處理常式。

private void Media_MediaFailed(object sender, ExceptionRoutedEventArgs args)
{
    MessageBox.Show(args.ErrorException.Message);
}
Private Sub Media_MediaFailed(ByVal sender As Object, ByVal args As ExceptionRoutedEventArgs)
    If (True) Then
        MessageBox.Show(args.ErrorException.Message)
    End If
End Sub

適用於