FileFormatException Konstruktorer

Definition

Skapar en ny instans av FileFormatException klassen.

Överlagringar

Name Description
FileFormatException()

Skapar en ny instans av FileFormatException klassen.

FileFormatException(String)

Skapar en ny instans av FileFormatException klassen med ett angivet felmeddelande.

FileFormatException(Uri)

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde.

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

Skapar en ny instans av FileFormatException klassen och initierar den med serialiserade data. Den här konstruktorn anropas under deserialiseringen för att återskapa undantagsobjektet som överförs via en ström.

FileFormatException(String, Exception)

Skapar en ny instans av FileFormatException klassen med ett angivet felmeddelande och en undantagstyp.

FileFormatException(Uri, Exception)

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde och en undantagstyp.

FileFormatException(Uri, String)

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde och ett angivet felmeddelande.

FileFormatException(Uri, String, Exception)

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde, ett angivet felmeddelande och en undantagstyp.

FileFormatException()

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen.

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

Kommentarer

Den här konstruktorn använder ett standardsystemmeddelande som beskriver felet, till exempel "En indatafil eller en dataström överensstämmer inte med den förväntade filformatspecifikationen". Det här meddelandet tar hänsyn till den aktuella systemkulturen.

Gäller för

FileFormatException(String)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett angivet felmeddelande.

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

Parametrar

message
String

Ett String värde som representerar felmeddelandet.

Gäller för

FileFormatException(Uri)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde.

public:
 FileFormatException(Uri ^ sourceUri);
public FileFormatException(Uri? sourceUri);
public FileFormatException(Uri sourceUri);
new System.IO.FileFormatException : Uri -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri)

Parametrar

sourceUri
Uri

Värdet Uri för filen som orsakade det här felet.

Kommentarer

Den här konstruktorn initierar egenskapen för den nya Message instansen FileFormatException till ett meddelande från systemet som beskriver felet och innehåller filnamnet, till exempel "Filen "sourceUri" överensstämmer inte med den förväntade filformatspecifikationen. Det här meddelandet tar hänsyn till den aktuella systemkulturen.

Egenskapen SourceUri initieras med hjälp av parametern sourceUri .

Gäller för

FileFormatException(SerializationInfo, StreamingContext)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Varning

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

Skapar en ny instans av FileFormatException klassen och initierar den med serialiserade data. Den här konstruktorn anropas under deserialiseringen för att återskapa undantagsobjektet som överförs via en ström.

protected:
 FileFormatException(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 FileFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected FileFormatException(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 System.IO.FileFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileFormatException
new System.IO.FileFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileFormatException
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

Gäller för

FileFormatException(String, Exception)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett angivet felmeddelande och en undantagstyp.

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

Parametrar

message
String

Ett String värde som representerar felmeddelandet.

innerException
Exception

Värdet för InnerException egenskapen, som representerar orsaken till det aktuella undantaget.

Kommentarer

Den här konstruktorn initierar egenskapen för Message den nya FileFormatException instansen med det angivna felmeddelandet som representeras av message.

Gäller för

FileFormatException(Uri, Exception)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde och en undantagstyp.

public:
 FileFormatException(Uri ^ sourceUri, Exception ^ innerException);
public FileFormatException(Uri? sourceUri, Exception? innerException);
public FileFormatException(Uri sourceUri, Exception innerException);
new System.IO.FileFormatException : Uri * Exception -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, innerException As Exception)

Parametrar

sourceUri
Uri

Värdet Uri för filen som orsakade det här felet.

innerException
Exception

Värdet för InnerException egenskapen, som representerar orsaken till det aktuella undantaget.

Kommentarer

Den här konstruktorn initierar meddelandeegenskapen för den nya instansen till ett meddelande från systemet som beskriver felet och innehåller filnamnet, till exempel "Filen "sourceUri" överensstämmer inte med den förväntade filformatspecifikationen." Det här meddelandet tar hänsyn till den aktuella systemkulturen.

Egenskapen SourceUri initieras med hjälp av parametern sourceUri .

Gäller för

FileFormatException(Uri, String)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde och ett angivet felmeddelande.

public:
 FileFormatException(Uri ^ sourceUri, System::String ^ message);
public FileFormatException(Uri? sourceUri, string? message);
public FileFormatException(Uri sourceUri, string message);
new System.IO.FileFormatException : Uri * string -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, message As String)

Parametrar

sourceUri
Uri

Värdet Uri för filen som orsakade det här felet.

message
String

Ett String värde som representerar felmeddelandet.

Kommentarer

Den här konstruktorn initierar egenskapen för Message den nya FileFormatException instansen med det angivna felmeddelandet som representeras av message. 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.

Egenskapen SourceUri initieras med hjälp av parametern sourceUri .

Gäller för

FileFormatException(Uri, String, Exception)

Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs
Källa:
FileFormatException.cs

Skapar en ny instans av FileFormatException klassen med ett käll-URI-värde, ett angivet felmeddelande och en undantagstyp.

public:
 FileFormatException(Uri ^ sourceUri, System::String ^ message, Exception ^ innerException);
public FileFormatException(Uri? sourceUri, string? message, Exception? innerException);
public FileFormatException(Uri sourceUri, string message, Exception innerException);
new System.IO.FileFormatException : Uri * string * Exception -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, message As String, innerException As Exception)

Parametrar

sourceUri
Uri

Värdet Uri för filen som orsakade det här felet.

message
String

Ett String värde som representerar felmeddelandet.

innerException
Exception

Värdet för InnerException egenskapen, som representerar orsaken till det aktuella undantaget.

Kommentarer

Den här konstruktorn initierar egenskapen Meddelande för den nya instansen med hjälp av meddelandeparametern. 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.

Egenskapen SourceUri initieras med hjälp av parametern sourceUri .

Gäller för