[英]Convert String to Byte Array in VB.Net
我的目標是做到以下幾點
我該如何進行轉換?
所以在這種情況下,結果將如下所示:
Dim oneByte() As Byte = {&H5E, &H57, &HE2, &HDC}
oneByte(0)= 5E
oneByte(1)= 57
等等...
使用幾種標准方法
Dim ut As Integer = 1582818012
Dim uts As String = Convert.ToString(ut, 16)
'look at oneByte in hex
Dim oneByte() As Byte = BitConverter.GetBytes(ut).Reverse.ToArray
' (0) &H5E Byte
' (1) &H57 Byte
' (2) &HE2 Byte
' (3) &HDC Byte
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.