ResourceWriter::AddResource Method (String^, array<Byte>^)
.NET Framework (current version)
Adds a named resource specified as a byte array to the list of resources to be written.
Assembly: mscorlib (in mscorlib.dll)
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.
.NET Framework
Available since 1.1
Available since 1.1
Show: