Converts a string of hex digits into bytes into a byte array.

Namespace: CardWerk.SmartCard.Util
Assembly: CardWerk.SmartCard (in CardWerk.SmartCard.dll)

Public Shared Sub ToByteArray( _ 
ByVal sHex As String, _ 
ByVal vb As Byte(), _ 
ByVal nOffset As Integer
)
This language is not supported or no code example is available.
public static void ToByteArray( 
string sHex
byte[] vb
int nOffset 
)
This language is not supported or no code example is available.
public:  
static void ToByteArray( 
String^ sHex
array< Byte >^ vb
int nOffset 
)
This language is not supported or no code example is available.
public static function ToByteArray( 
sHex : String
vb : byte[], 
nOffset : int 
);
This language is not supported or no code example is available.

Parameters

sHex
Type: string

String of hex digits. This string must not be null and must have an even length. If it is null, then an ArgumentNullException will be thrown. The hex digits may be upper or lower case. If it is not of even length or contains characters that are not valid hex digits, then an ArgumentException will be thrown.

vb
Type: byte[]

The destination byte array where the individual bytes of the given string shall be stored.

nOffset
Type: int

Offset into the byte array where the first character shall be stored.

Exception type Condition

ArgumentException

Thrown when one or more arguments have unsupported or illegal values.

ArgumentNullException

Thrown when one or more required arguments are null.

.NET Framework

Supported in: 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

.NET Core

Supported in: 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0

.NET Standard

Supported in: 2.0