通用十、十六进制数据处理类
通用十、十六进制数据处理类
C# Code:
public static string Ten2Hex(string ten)
{
ulong tenValue = Convert.ToUInt64(ten);
ulong divValue, resValue;
string hex = "";
do
{
divValue = (ulong)(tenValue / 16);
resValue = tenValue % 16;
hex = tenValue2Char(resValue) hex;
tenValue = divValue;
}
while (tenValue >= 16);
if (tenValue != 0)
hex = tenValue2Char(tenValue) hex;
return hex;
}
扫一扫加作者微信