FileLoadException Construtores

Definição

Inicializa uma nova instância da classe FileLoadException.Initializes a new instance of the FileLoadException class.

Sobrecargas

FileLoadException()

Inicializa uma nova instância da classe FileLoadException, configurando a propriedade Message da nova instância como uma mensagem fornecida pelo sistema que descreve o erro, tal como "Não foi possível carregar o arquivo especificado".Initializes a new instance of the FileLoadException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "Could not load the specified file." Essa mensagem considera a cultura do sistema atual.This message takes into account the current system culture.

FileLoadException(String)

Inicializa uma nova instância da classe FileLoadException com a mensagem de erro especificada.Initializes a new instance of the FileLoadException class with the specified error message.

FileLoadException(SerializationInfo, StreamingContext)

Inicializa uma nova instância da classe FileLoadException com dados serializados.Initializes a new instance of the FileLoadException class with serialized data.

FileLoadException(String, Exception)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the FileLoadException class with a specified error message and a reference to the inner exception that is the cause of this exception.

FileLoadException(String, String)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada e o nome do arquivo que não pôde ser carregado.Initializes a new instance of the FileLoadException class with a specified error message and the name of the file that could not be loaded.

FileLoadException(String, String, Exception)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada, o nome do arquivo que não pôde ser carregado e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the FileLoadException class with a specified error message, the name of the file that could not be loaded, and a reference to the inner exception that is the cause of this exception.

FileLoadException()

Inicializa uma nova instância da classe FileLoadException, configurando a propriedade Message da nova instância como uma mensagem fornecida pelo sistema que descreve o erro, tal como "Não foi possível carregar o arquivo especificado".Initializes a new instance of the FileLoadException class, setting the Message property of the new instance to a system-supplied message that describes the error, such as "Could not load the specified file." Essa mensagem considera a cultura do sistema atual.This message takes into account the current system culture.

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

Comentários

A InnerException propriedade e a FileName propriedade da nova instância são inicializadas para null .The InnerException property and FileName property of the new instance are initialized to null.

Aplica-se a

FileLoadException(String)

Inicializa uma nova instância da classe FileLoadException com a mensagem de erro especificada.Initializes a new instance of the FileLoadException class with the specified error message.

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

Parâmetros

message
String

Um String que descreve o erro.A String that describes the error. O conteúdo de message deve ser compreendido por humanos.The content of message is intended to be understood by humans. O chamador deste construtor é obrigatório para garantir que esta cadeia de caracteres foi localizada para a cultura do sistema atual.The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Comentários

Esse construtor inicializa a Message propriedade da nova instância usando message .This constructor initializes the Message property of the new instance using message. A InnerException propriedade e a FileName propriedade da nova instância são inicializadas para null .The InnerException property and FileName property of the new instance are initialized to null.

Aplica-se a

FileLoadException(SerializationInfo, StreamingContext)

Inicializa uma nova instância da classe FileLoadException com dados serializados.Initializes a new instance of the FileLoadException class with serialized data.

protected:
 FileLoadException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected FileLoadException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.FileLoadException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileLoadException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parâmetros

info
SerializationInfo

O SerializationInfo que mantém os dados de objeto serializados sobre a exceção que está sendo lançada.The SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext

O StreamingContext que contém informações contextuais sobre a fonte ou o destino.The StreamingContext that contains contextual information about the source or destination.

Aplica-se a

FileLoadException(String, Exception)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the FileLoadException class with a specified error message and a reference to the inner exception that is the cause of this exception.

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

Parâmetros

message
String

Um String que descreve o erro.A String that describes the error. O conteúdo de message deve ser compreendido por humanos.The content of message is intended to be understood by humans. O chamador deste construtor é obrigatório para garantir que esta cadeia de caracteres foi localizada para a cultura do sistema atual.The caller of this constructor is required to ensure that this string has been localized for the current system culture.

inner
Exception

A exceção que é a causa da exceção atual.The exception that is the cause of the current exception. Caso o parâmetro inner não seja null, a exceção atual é acionada em um bloco catch que identifica a exceção interna.If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Comentários

Uma exceção que é lançada como um resultado direto de uma exceção anterior deve incluir uma referência para a exceção anterior na propriedade InnerException.An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. A propriedade InnerException retorna o mesmo valor passado ao construtor, ou null se a propriedade InnerException não fornecer o valor da exceção interna ao construtor.The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

A tabela a seguir mostra os valores de propriedade inicial de uma instância de FileLoadException.The following table shows the initial property values for an instance of FileLoadException.

PropriedadeProperty ValorValue
InnerException A referência de exceção interna.The inner exception reference.
Message A cadeia de caracteres da mensagem de erro.The error message string.

Para obter mais informações sobre exceções internas, consulte InnerException .For more information on inner exceptions, see InnerException.

Confira também

Aplica-se a

FileLoadException(String, String)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada e o nome do arquivo que não pôde ser carregado.Initializes a new instance of the FileLoadException class with a specified error message and the name of the file that could not be loaded.

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

Parâmetros

message
String

Um String que descreve o erro.A String that describes the error. O conteúdo de message deve ser compreendido por humanos.The content of message is intended to be understood by humans. O chamador deste construtor é obrigatório para garantir que esta cadeia de caracteres foi localizada para a cultura do sistema atual.The caller of this constructor is required to ensure that this string has been localized for the current system culture.

fileName
String

Um String que contém o nome do arquivo que não foi carregado.A String containing the name of the file that was not loaded.

Comentários

Esse construtor inicializa a Message propriedade da nova instância usando message e a FileName propriedade usando fileName .This constructor initializes the Message property of the new instance using message and the FileName property using fileName. A InnerException propriedade da nova instância é inicializada para null .The InnerException property of the new instance is initialized to null.

FileName Não é necessário para ser um arquivo armazenado em disco; pode ser qualquer parte de um sistema que dê suporte ao acesso a fluxos.FileName is not required to be a file stored on disk; it can be any part of a system that supports access to streams. Por exemplo, dependendo do sistema, essa classe pode ser capaz de acessar um dispositivo físico.For example, depending on the system, this class might be able to access a physical device.

Aplica-se a

FileLoadException(String, String, Exception)

Inicializa uma nova instância da classe FileLoadException com uma mensagem de erro especificada, o nome do arquivo que não pôde ser carregado e uma referência à exceção interna que é a causa da exceção.Initializes a new instance of the FileLoadException class with a specified error message, the name of the file that could not be loaded, and a reference to the inner exception that is the cause of this exception.

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

Parâmetros

message
String

Um String que descreve o erro.A String that describes the error. O conteúdo de message deve ser compreendido por humanos.The content of message is intended to be understood by humans. O chamador deste construtor é obrigatório para garantir que esta cadeia de caracteres foi localizada para a cultura do sistema atual.The caller of this constructor is required to ensure that this string has been localized for the current system culture.

fileName
String

Um String que contém o nome do arquivo que não foi carregado.A String containing the name of the file that was not loaded.

inner
Exception

A exceção que é a causa da exceção atual.The exception that is the cause of the current exception. Caso o parâmetro inner não seja null, a exceção atual é acionada em um bloco catch que identifica a exceção interna.If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Comentários

Uma exceção que é lançada como um resultado direto de uma exceção anterior deve incluir uma referência para a exceção anterior na propriedade InnerException.An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. A propriedade InnerException retorna o mesmo valor passado ao construtor, ou null se a propriedade InnerException não fornecer o valor da exceção interna ao construtor.The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

FileName Não é necessário para ser um arquivo armazenado em disco; pode ser qualquer parte de um sistema que dê suporte ao acesso a fluxos.FileName is not required to be a file stored on disk; it can be any part of a system that supports access to streams. Por exemplo, dependendo do sistema, essa classe pode ser capaz de acessar um dispositivo físico.For example, depending on the system, this class might be able to access a physical device.

A tabela a seguir mostra os valores de propriedade inicial de uma instância de FileLoadException.The following table shows the initial property values for an instance of FileLoadException.

PropriedadeProperty ValorValue
InnerException A referência de exceção interna.The inner exception reference.
Message A cadeia de caracteres da mensagem de erro.The error message string.

Para obter mais informações sobre exceções internas, consulte InnerException .For more information on inner exceptions, see InnerException.

Confira também

Aplica-se a