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
Byte[]
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
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET