DivideByZeroException Konstruktorer

Definition

Initierar en ny instans av DivideByZeroException klassen.

Överlagringar

Name Description
DivideByZeroException()

Initierar en ny instans av DivideByZeroException klassen.

DivideByZeroException(String)

Initierar en ny instans av DivideByZeroException klassen med ett angivet felmeddelande.

DivideByZeroException(SerializationInfo, StreamingContext)
Föråldrad.

Initierar en ny instans av DivideByZeroException klassen med serialiserade data.

DivideByZeroException(String, Exception)

Initierar en ny instans av DivideByZeroException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

DivideByZeroException()

Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs

Initierar en ny instans av DivideByZeroException klassen.

public:
 DivideByZeroException();
public DivideByZeroException();
Public Sub New ()

Kommentarer

Den här konstruktorn initierar egenskapen för den nya instansen Message till ett meddelande från systemet som beskriver felet, till exempel "Försök att dividera med noll". Det här meddelandet tar hänsyn till den aktuella systemkulturen.

I följande tabell visas de inledande egenskapsvärdena för en instans av DivideByZeroException.

Fastighet Value
InnerException En null-referens (Nothing i Visual Basic).
Message Den lokaliserade felmeddelandesträngen.

Gäller för

DivideByZeroException(String)

Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs

Initierar en ny instans av DivideByZeroException klassen med ett angivet felmeddelande.

public:
 DivideByZeroException(System::String ^ message);
public DivideByZeroException(string message);
public DivideByZeroException(string? message);
new DivideByZeroException : string -> DivideByZeroException
Public Sub New (message As String)

Parametrar

message
String

En String som beskriver felet.

Kommentarer

Innehållet message i är avsett att förstås av människor. Anroparen för den här konstruktorn krävs för att säkerställa att den här strängen har lokaliserats för den aktuella systemkulturen.

I följande tabell visas de inledande egenskapsvärdena för en instans av DivideByZeroException.

Fastighet Value
InnerException En null-referens (Nothing i Visual Basic).
Message Felmeddelandesträngen.

Gäller för

DivideByZeroException(SerializationInfo, StreamingContext)

Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs

Varning

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initierar en ny instans av DivideByZeroException klassen med serialiserade data.

protected:
 DivideByZeroException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected DivideByZeroException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected DivideByZeroException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new DivideByZeroException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> DivideByZeroException
new DivideByZeroException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> DivideByZeroException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parametrar

info
SerializationInfo

Objektet som innehåller serialiserade objektdata.

context
StreamingContext

Sammanhangsinformation om källan eller målet.

Attribut

Kommentarer

Den här konstruktorn anropas under deserialiseringen för att återskapa undantagsobjektet som överförs via en ström.

Gäller för

DivideByZeroException(String, Exception)

Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs
Källa:
DivideByZeroException.cs

Initierar en ny instans av DivideByZeroException klassen med ett angivet felmeddelande och en referens till det inre undantaget som är orsaken till det här undantaget.

public:
 DivideByZeroException(System::String ^ message, Exception ^ innerException);
public DivideByZeroException(string message, Exception innerException);
public DivideByZeroException(string? message, Exception? innerException);
new DivideByZeroException : string * Exception -> DivideByZeroException
Public Sub New (message As String, innerException As Exception)

Parametrar

message
String

Felmeddelandet som förklarar orsaken till undantaget.

innerException
Exception

Undantaget som är orsaken till det aktuella undantaget. Om parametern innerException inte nullär genereras det aktuella undantaget i ett catch block som hanterar det inre undantaget.

Kommentarer

Ett undantag som genereras som ett direkt resultat av ett tidigare undantag bör innehålla en referens till det tidigare undantaget i InnerException egenskapen. Egenskapen InnerException returnerar samma värde som skickas till konstruktorn, eller null om InnerException egenskapen inte anger det inre undantagsvärdet till konstruktorn.

I följande tabell visas de inledande egenskapsvärdena för en instans av DivideByZeroException.

Egenskapstyp Tillstånd
InnerException Den inre undantagsreferensen.
Message Felmeddelandesträngen.

Se även

Gäller för