Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a resource to the list of resources to be written to an output file or output stream.
AddResource(String, Byte[]) |
Adds an 8-bit unsigned integer array as a named resource to the list of resources to be written. |
AddResource(String, Object) |
Adds a named resource of type Object to the list of resources to be written. |
AddResource(String, String) |
Adds a named resource of type String to the list of resources to be written. |
Adds an 8-bit unsigned integer array as a named resource to the list of resources to be written.
public:
void AddResource(System::String ^ name, cli::array <System::Byte> ^ value);
public void AddResource(string name, byte[]? value);
public void AddResource(string name, byte[] value);
abstract member AddResource : string * byte[] -> unit
Public Sub AddResource (name As String, value As Byte())
Name of a resource.
Value of a resource as an 8-bit unsigned integer array.
The name
parameter is null
.
The resources are not written until the Generate method is called.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Adds a named resource of type Object to the list of resources to be written.
public:
void AddResource(System::String ^ name, System::Object ^ value);
public void AddResource(string name, object? value);
public void AddResource(string name, object value);
abstract member AddResource : string * obj -> unit
Public Sub AddResource (name As String, value As Object)
The name of the resource.
The value of the resource.
The name
parameter is null
.
The resource is not written until the Generate method is called.
Note
value
might have to be serializable, so you might have to provide a type converter, depending on which resource writer is used.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Adds a named resource of type String to the list of resources to be written.
public:
void AddResource(System::String ^ name, System::String ^ value);
public void AddResource(string name, string? value);
public void AddResource(string name, string value);
abstract member AddResource : string * string -> unit
Public Sub AddResource (name As String, value As String)
The name of the resource.
The value of the resource.
The name
parameter is null
.
The resource is not written until the Generate method is called.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in