最初のステップ(i = 0)でエラー "OverflowException"が発生しました。このコードで何が間違っていますか?BitConverter.ToInt64 OverflowException
Dim byteArray As Byte() = { _
0, 54, 101, 196, 255, 255, 255, 255, 0, 0, _
0, 0, 0, 0, 0, 0, 128, 0, 202, 154, _
59, 0, 0, 0, 0, 1, 0, 0, 0, 0, _
255, 255, 255, 255, 1, 0, 0, 255, 255, 255, _
255, 255, 255, 255, 127, 86, 85, 85, 85, 85, _
85, 255, 255, 170, 170, 170, 170, 170, 170, 0, _
0, 100, 167, 179, 182, 224, 13, 0, 0, 156, _
88, 76, 73, 31, 242}
Dim UintList As New List(Of UInt64)
For i As Integer = 0 To byteArray.Count - 1 Step 8
UintList.Add(BitConverter.ToInt64(byteArray, i))
Next
は、あなたはそれが 'ArgumentException'ないのですか? – dasblinkenlight
http://stackoverflow.com/questions/9804265/how-does-bitconverter-toint64-handles-a-byte-arry-with-32-bytes-a-256-bit-hash –
Put Option Strict On the topコンパイラがなぜこれが間違っているのかを知るのを助けるソースコードファイルの。この例外をスローするBitConverterではありません。これは、無効なInt64からUInt64への変換です。代わりにBitConverter.ToUInt64()を使用してください。または、List(Of Int64)が必要な場合は、推測が困難です。 –