【发布时间】:2018-12-12 10:16:29
【问题描述】:
我有 16 个字节的字符串,我向左移动,在我向左移动后,我试图在 RichTextbox 中显示结果:
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim positiveString As String = "00082B002C421A21B630B934B7B71C9A99"
Dim posBigInt As BigInteger = 0
posBigInt = BigInteger.Parse(positiveString, System.Globalization.NumberStyles.AllowHexSpecifier)
posBigInt = (posBigInt << 1)
RichTextBox1.Text = Hex(posBigInt.ToString)
End Sub
Public Function StrToHex(ByRef Data As String) As String
Dim sVal As String
Dim sHex As String = ""
While Data.Length > 0
sVal = Conversion.Hex(Strings.Asc(Data.Substring(0, 1).ToString()))
Data = Data.Substring(1, Data.Length - 1)
sHex = sHex & sVal
End While
Return sHex
End Function
StrToHex 函数给了我错误的输出,如果我尝试 Hex(posBigInt.ToString) 给我正确的输出,如果值适合 uint64,因此 Hex() 不能适合 biginterger
【问题讨论】:
标签: string vb.net hex biginteger