IResourceWriter.AddResource Method
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())
Parameters
- name
- String
Name of a resource.
- value
- Byte[]
Value of a resource as an 8-bit unsigned integer array.
Exceptions
The name
parameter is null
.
Remarks
The resources are not written until the Generate method is called.
Applies to
.NET 10 и други версии
Продукт | Версии |
---|---|
.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)
Parameters
- name
- String
The name of the resource.
- value
- Object
The value of the resource.
Exceptions
The name
parameter is null
.
Remarks
The resource is not written until the Generate method is called.
Бележка
value
might have to be serializable, so you might have to provide a type converter, depending on which resource writer is used.
Applies to
.NET 10 и други версии
Продукт | Версии |
---|---|
.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)
Parameters
- name
- String
The name of the resource.
- value
- String
The value of the resource.
Exceptions
The name
parameter is null
.
Remarks
The resource is not written until the Generate method is called.
Applies to
.NET 10 и други версии
Продукт | Версии |
---|---|
.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
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: