通用十、十六进制数据处理类
通用十、十六进制数据处理类
扫一扫加作者微信
C# Code:
//是十进制转十六进制
public static string Ten2Hex(string ten)
{
ulong tenValue = Convert.ToUInt64(ten);
ulong divValue, resValue;
string hex = "";
do
{
divValue = (ulong)(tenValue / 16);// (ulong)Math.Floor((double)(tenValue / 16));
resValue = tenValue % 16;
hex = tenValue2Char(resValue) hex;
tenValue = divValue;
}
while (tenValue >= 16);
if (tenValue != 0)
hex = tenValue2Char(tenValue) hex;
return hex;
}
//来源:C/S框架网(www.csframework.com) QQ:1980854898
//是十进制转十六进制
public static string Ten2Hex(string ten)
{
ulong tenValue = Convert.ToUInt64(ten);
ulong divValue, resValue;
string hex = "";
do
{
divValue = (ulong)(tenValue / 16);// (ulong)Math.Floor((double)(tenValue / 16));
resValue = tenValue % 16;
hex = tenValue2Char(resValue) hex;
tenValue = divValue;
}
while (tenValue >= 16);
if (tenValue != 0)
hex = tenValue2Char(tenValue) hex;
return hex;
}
//来源:C/S框架网(www.csframework.com) QQ:1980854898
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网