1个回答
展开全部
把十六进制转成字符串后调用下列函数即可
private
static
long
HexStr2Dec(string
hexStr)
{
char[]
hexCharList
=
hexStr.ToCharArray();
long
result
=
0;
for
(int
i
=
0;
i
<
hexCharList.Length;
i++)
{
result
+=
HexChar2Dec(hexCharList[hexCharList.Length
-
1
-
i])
*
Power(16,
i);
}
return
result;
}
十六进制
private
static
long
HexStr2Dec(string
hexStr)
{
char[]
hexCharList
=
hexStr.ToCharArray();
long
result
=
0;
for
(int
i
=
0;
i
<
hexCharList.Length;
i++)
{
result
+=
HexChar2Dec(hexCharList[hexCharList.Length
-
1
-
i])
*
Power(16,
i);
}
return
result;
}
十六进制
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询