BerConverter.Encode(String, Object[]) Method
Definition
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.
The Encode(String, Object[]) method encodes structured data, using BER, to retrieve a binary representation of the data.
public:
static cli::array <System::Byte> ^ Encode(System::String ^ format, ... cli::array <System::Object ^> ^ value);
public static byte[] Encode (string format, params object[] value);
static member Encode : string * obj[] -> byte[]
Public Shared Function Encode (format As String, ParamArray value As Object()) As Byte()
Parameters
- format
- String
The format string.
- value
- Object[]
An array of formatted data.
Returns
An array of BER-encoded data.
Remarks
The following are valid format characters.
Encoding rules:
Code | Corresponding Argument |
---|---|
'{' '}' '[' ']' 'n' | No corresponding argument |
't' 'i' 'e' | int |
'a' | Octet string |
'b' | bool |
's' | string |
'o' 'X' | byte[] |
'v' | string[] |
'V' | byte[][] |
Note
'v' and 'V' are special in that a double {} is required. For example, use {{v}} and {{V}}.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | format is a null reference (Nothing in Visual Basic). |
ArgumentException | This exception occurs in any one of the following conditions: - There are not enough arguments for the format string. - The format string argument is incorrect. - The format string contains an undefined character. |
BerConversionException | Error processing return value. |
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om