ResourceWriter::AddResource Method (String^, array<Byte>^)

 

Adds a named resource specified as a byte array to the list of resources to be written.

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

public:
virtual void AddResource(
	String^ name,
	array<unsigned char>^ value
) sealed

Parameters

name
Type: System::String^

The name of the resource.

value
Type: array<System::Byte>^

Value of the resource as an 8-bit unsigned integer array.

Exception Condition
ArgumentException

name (or a name that varies only by capitalization) has already been added to this ResourceWriter.

ArgumentNullException

The name parameter is null.

InvalidOperationException

This ResourceWriter has been closed and its hash table is unavailable.

The resource is not written until Generate is called.

You can retrieve the resources written by the AddResource(String^, array<Byte>^) method by calling the ResourceManager::GetStream method.

The following example uses the AddResource(String^, array<Byte>^) method to add a graphics image that has been read as an array of bytes to a ResourceWriter object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: