This documentation is archived and is not being maintained.

Assembly.GetFile Method

Gets a FileStream for the specified file in the file table of the manifest of this assembly.

[Visual Basic]
Public Overridable Function GetFile( _
   ByVal name As String _
) As FileStream
[C#]
public virtual FileStream GetFile(
 string name
);
[C++]
public: virtual FileStream* GetFile(
 String* name
);
[JScript]
public function GetFile(
   name : String
) : FileStream;

Parameters

name
The name of the specified file.

Return Value

A FileStream for the specified file, or a null reference (Nothing in Visual Basic) if the file is not found.

Exceptions

Exception Type Condition
FileLoadException A file that was found could not be loaded.
ArgumentNullException The name parameter is a null reference (Nothing in Visual Basic).
SecurityException The caller does not have the required permission.
ArgumentException The name parameter is the empty string ("").

Remarks

This method works on both public and private resources. name should not include the path to the file.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Assembly Class | Assembly Members | System.Reflection Namespace

Show: