Exception Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar fel som uppstår under programkörningen.
public ref class Exception
public ref class Exception : System::Runtime::Serialization::ISerializable
public ref class Exception : System::Runtime::InteropServices::_Exception, System::Runtime::Serialization::ISerializable
public class Exception
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)]
[System.Serializable]
public class Exception : System.Runtime.Serialization.ISerializable
[System.Serializable]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public class Exception : System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
public class Exception : System.Runtime.Serialization.ISerializable
type Exception = class
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)>]
[<System.Serializable>]
type Exception = class
interface ISerializable
[<System.Serializable>]
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Exception = class
interface ISerializable
interface _Exception
type Exception = class
interface ISerializable
Public Class Exception
Public Class Exception
Implements ISerializable
Public Class Exception
Implements _Exception, ISerializable
- Arv
-
Exception
- Härledda
- Attribut
- Implementeringar
Kommentarer
Mer information om det här API:et finns i Kompletterande API-kommentarer för Undantag.
Konstruktorer
| Name | Description |
|---|---|
| Exception() |
Initierar en ny instans av Exception klassen. |
| Exception(SerializationInfo, StreamingContext) |
Initierar en ny instans av Exception klassen med serialiserade data. |
| Exception(String, Exception) |
Initierar en ny instans av Exception klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget. |
| Exception(String) |
Initierar en ny instans av Exception klassen med ett angivet felmeddelande. |
Egenskaper
| Name | Description |
|---|---|
| Data |
Hämtar en samling nyckel/värde-par som ger ytterligare användardefinierad information om undantaget. |
| HelpLink |
Hämtar eller anger en länk till hjälpfilen som är associerad med det här undantaget. |
| HResult |
Hämtar eller anger HRESULT, ett kodat numeriskt värde som har tilldelats ett specifikt undantag. |
| InnerException |
Hämtar den Exception instans som orsakade det aktuella undantaget. |
| Message |
Hämtar ett meddelande som beskriver det aktuella undantaget. |
| Source |
Hämtar eller anger namnet på programmet eller objektet som orsakar felet. |
| StackTrace |
Hämtar en strängrepresentation av de omedelbara ramarna i anropsstacken. |
| TargetSite |
Hämtar den metod som utlöser det aktuella undantaget. |
Metoder
| Name | Description |
|---|---|
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetBaseException() |
När den åsidosätts i en härledd klass returnerar den Exception som är rotorsaken till ett eller flera efterföljande undantag. |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetObjectData(SerializationInfo, StreamingContext) |
När åsidosättas i en härledd klass anger du SerializationInfo med information om undantaget. |
| GetType() |
Hämtar körningstypen för den aktuella instansen. |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| ToString() |
Skapar och returnerar en strängrepresentation av det aktuella undantaget. |
Händelser
| Name | Description |
|---|---|
| SerializeObjectState |
Inträffar när ett undantag serialiseras för att skapa ett undantagstillståndsobjekt som innehåller serialiserade data om undantaget. |