C#如何把BYTE数组中的数转换成16进制

来源:百度知道 编辑:UC知道 时间:2024/05/19 12:50:17
现在有一个BYTE数组,如
Byte[]b={12,10,1,17...};
现在要把它转化为16进制的数组
{0C,0A,01,10...}

using System;

using System.Collections.Generic;

using System.Text;

namespace ConsoleApplication3

{

class Program

{

static void Main(string[] args)

{

byte[] b = {12,10,1,17};

for (int i = 0; i < b.Length; i++)

{

string a =Convert.ToString(b[i], 16);

Console.WriteLine("O"+a);

}

}

}

}

扩展资料:

C# 16进制的转换

/十进制转二进制

Con