Bearbeiten

Freigeben über


FileFormatException Constructors

Definition

Creates a new instance of the FileFormatException class.

Overloads

FileFormatException()

Creates a new instance of the FileFormatException class.

FileFormatException(String)

Creates a new instance of the FileFormatException class with a specified error message.

FileFormatException(Uri)

Creates a new instance of the FileFormatException class with a source URI value.

FileFormatException(SerializationInfo, StreamingContext)
Obsolete.

Creates a new instance of the FileFormatException class and initializes it with serialized data. This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

FileFormatException(String, Exception)

Creates a new instance of the FileFormatException class with a specified error message and exception type.

FileFormatException(Uri, Exception)

Creates a new instance of the FileFormatException class with a source URI value and an exception type.

FileFormatException(Uri, String)

Creates a new instance of the FileFormatException class with a source URI value and a specified error message.

FileFormatException(Uri, String, Exception)

Creates a new instance of the FileFormatException class with a source URI value, a specified error message, and an exception type.

FileFormatException()

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class.

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

Remarks

This constructor uses a default system message that describes the error, such as "An input file or a data stream does not conform to the expected file format specification." This message takes into account the current system culture.

Applies to

FileFormatException(String)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a specified error message.

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)

Parameters

message
String

A String value that represents the error message.

Applies to

FileFormatException(Uri)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a source URI value.

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)

Parameters

sourceUri
Uri

The Uri value of the file that caused this error.

Remarks

This constructor initializes the Message property of the new FileFormatException instance to a system-supplied message that describes the error and includes the file name, such as "The file 'sourceUri' does not conform to the expected file format specification." This message takes into account the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

Applies to

FileFormatException(SerializationInfo, StreamingContext)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Caution

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

Creates a new instance of the FileFormatException class and initializes it with serialized data. This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

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}")]
protected FileFormatException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.FileFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileFormatException
[<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
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

The object that holds the serialized object data.

context
StreamingContext

The contextual information about the source or destination.

Attributes

Applies to

FileFormatException(String, Exception)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a specified error message and exception type.

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)

Parameters

message
String

A String value that represents the error message.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new FileFormatException instance with the specified error message represented by message.

Applies to

FileFormatException(Uri, Exception)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a source URI value and an exception type.

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)

Parameters

sourceUri
Uri

The Uri value of the file that caused this error.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error and includes the file name, such as "The file 'sourceUri' does not conform to the expected file format specification." This message takes into account the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

Applies to

FileFormatException(Uri, String)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a source URI value and a specified error message.

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)

Parameters

sourceUri
Uri

The Uri value of the file that caused this error.

message
String

A String value that represents the error message.

Remarks

This constructor initializes the Message property of the new FileFormatException instance with the specified error message represented by message. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

Applies to

FileFormatException(Uri, String, Exception)

Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs
Source:
FileFormatException.cs

Creates a new instance of the FileFormatException class with a source URI value, a specified error message, and an exception type.

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)

Parameters

sourceUri
Uri

The Uri value of the file that caused this error.

message
String

A String value that represents the error message.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new instance using the message parameter. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

Applies to