?? hexcon.cs
字號:
?using System;
using System.Collections.Generic;
using System.Text;
namespace Fingerprint
{
class HexCon
{
// 把十六進(jìn)制字符串轉(zhuǎn)換成字節(jié)型和把字節(jié)型轉(zhuǎn)換成十六進(jìn)制字符串 converter hex string to byte and byte to hex string
public static string ByteToString(byte[] InBytes)
{
string StringOut = "";
foreach (byte InByte in InBytes)
{
StringOut = StringOut + String.Format("{0:X2} ", InByte);
}
return StringOut;
}
public static byte[] StringToByte(string InString)
{
string[] ByteStrings;
ByteStrings = InString.Split(" ".ToCharArray());
byte[] ByteOut;
ByteOut = new byte[ByteStrings.Length];
for (int i = 0; i < ByteStrings.Length; i++)
{
//byte x = Convert.ToByte(("0x" + ByteStrings[i]));
//ByteOut[i] = Convert.ToByte(("0x" + ByteStrings[i]), 16);
ByteOut[i] = Convert.ToByte(ByteStrings[i], 16);
}
return ByteOut;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -