ExceptionRoutedEventArgs.ErrorException 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取导致错误条件的异常。
public:
property Exception ^ ErrorException { Exception ^ get(); };
public Exception ErrorException { get; }
member this.ErrorException : Exception
Public ReadOnly Property ErrorException As Exception
属性值
详细说明特定错误条件的异常。
例外
拒绝访问媒体文件的尝试。
找不到媒体文件。
此时会显示 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