110,546
社区成员
发帖
与我相关
我的任务
分享
static void Main(string[] args)
{
string str = @"080003005844967d";
List<byte> bytes = new List<byte>();
for (int i = 0; i < str.Length; i += 2) {
string strTemp = str.Substring(i, 2);
byte b = Convert.ToByte(strTemp, 16);
bytes.Add(b);
}
byte[] result = bytes.ToArray();
foreach (byte b in result) {
Console.WriteLine("0x"+string.Format("{0:X}", b).PadLeft(2, '0'));
}
}