Assembly.GetFile(String) Método
Definição
Obtém um FileStream para o arquivo especificado na tabela de arquivo do manifesto desse assembly.Gets a FileStream for the specified file in the file table of the manifest of this assembly.
public:
virtual System::IO::FileStream ^ GetFile(System::String ^ name);
public virtual System.IO.FileStream? GetFile (string name);
public virtual System.IO.FileStream GetFile (string name);
abstract member GetFile : string -> System.IO.FileStream
override this.GetFile : string -> System.IO.FileStream
Public Overridable Function GetFile (name As String) As FileStream
Parâmetros
- name
- String
O nome do arquivo especificado.The name of the specified file. Não inclua o caminho para o arquivo.Do not include the path to the file.
Retornos
Um fluxo que contém o arquivo especificado ou null se o arquivo não for encontrado.A stream that contains the specified file, or null if the file is not found.
Implementações
Exceções
Não foi possível carregar um arquivo que foi encontrado.A file that was found could not be loaded.
O parâmetro name é null.The name parameter is null.
O parâmetro name é uma cadeia de caracteres vazia ("").The name parameter is an empty string ("").
name não foi encontrado.name was not found.
name não é um assembly válido.name is not a valid assembly.
Comentários
Esse método funciona em arquivos de recursos públicos e privados.This method works on both public and private resource files.
O name argumento não deve incluir o caminho para o arquivo.The name argument should not include the path to the file.
No .NET 5,0 e versões posteriores, para assemblies agrupados, esse método gera uma exceção.In .NET 5.0 and later versions, for bundled assemblies, this method throws an exception.