0 out of 4 rated this helpful - Rate this topic

Assembly.GetManifestResourceStream Method (Type, String)

Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public virtual Stream GetManifestResourceStream (
	Type type,
	string name
)
public Stream GetManifestResourceStream (
	Type type, 
	String name
)
public function GetManifestResourceStream (
	type : Type, 
	name : String
) : Stream

Parameters

type

The type whose namespace is used to scope the manifest resource name.

name

The case-sensitive name of the manifest resource being requested.

Return Value

A Stream representing this manifest resource.
Exception typeCondition

ArgumentNullException

The name parameter is a null reference (Nothing in Visual Basic).

ArgumentException

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

FileLoadException

A file that was found could not be loaded.

FileNotFoundException

name was not found.

BadImageFormatException

name is not a valid assembly.

Resource information is returned only if the resource is visible to the caller, or the caller has ReflectionPermission.

NoteNote

This method returns a null reference (Nothing in Visual Basic) if a private resource in another assembly is accessed and the caller does not have ReflectionPermission with the ReflectionPermissionFlag.TypeInformation flag.

If the full name of type is "MyNameSpace.MyClasses" and name is "Net", GetManifestResourceStream will search for a resource named MyNameSpace.Net.

  • ReflectionPermission  to access a private resource.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.