ExceptionRoutedEventArgs.ErrorException Egenskap

Definition

Hämtar undantaget som orsakade feltillståndet.

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

Egenskapsvärde

Undantaget som beskriver det specifika felvillkoret.

Undantag

Försöket att komma åt mediefilen nekas.

Det går inte att hitta mediefilen.

Mediefilformatet stöds inte av någon installerad codec.

-eller-

Filformatet känns inte igen.

Windows Media Player version 10 eller senare har inte identifierats.

-eller-

Videoresurser är otillräckliga för medieuppspelning.

En COM-felkod visas.

Exempel

I följande exempel skapas en enkel händelsehanterare för 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

Gäller för