//把byte[]类型数据 转换成 string 0xae00cf => "AE00CF "
public static string ToHexString(byte[] bytes)
{
string hexString = string.Empty;
if (bytes != null)
{
StringBuilder strB = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
strB.Append(bytes[i].ToString(" "));
strB.Append(bytes[i].ToString("X2"));
}
hexString = strB.ToString();
} return hexString;
}
c# byte[]转换成对应的string类型
最新推荐文章于 2024-06-24 10:56:24 发布