Assembly.GetFile(String) Assembly.GetFile(String) Assembly.GetFile(String) Assembly.GetFile(String) Method

Definition

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);
abstract member GetFile : string -> System.IO.FileStream
override this.GetFile : string -> System.IO.FileStream
Public Overridable Function GetFile (name As String) As FileStream

Parameters

name
String String String String

The name of the specified file. Do not include the path to the file.

Returns

A stream that contains the specified file, or null if the file is not found.

Implements

Exceptions

A file that was found could not be loaded.

The name parameter is an empty string ("").

Remarks

This method works on both public and private resource files.

The name should not include the path to the file.

Security

FileIOPermission
for access to the path and for reading the specified file. Associated enumerations: PathDiscovery and Read

Applies to