当我尝试使用以下代码将十六进制字符串转换为字节数组时,我收到此错误。请帮忙。
protected static byte[] HexStringToByte(string hexString)
{
try
{
int bytesCount = (hexString.Length) / 2;
byte[] bytes = new byte[bytesCount];
for (int x = 0; x < bytesCount; ++x)
{
bytes[x] = Convert.ToByte(hexString.Substring(x * 2, 2), 16);
}
return bytes;
}
catch
{
throw;
}
}
答案 0 :(得分:0)
HexaDecimal值
您在评论中分享的0ADB4DA38093W3350E49B0BA90O04A6C
无效。
所以问题出在你获得这个HexaDecimal值的代码中。