110,538
社区成员
发帖
与我相关
我的任务
分享
Public void HexCharToBytes(out byte[] bytesCharArray,strng strHexString)
{
int temp=0;
foreach(char charHex in strHexString.ToCharArray())
{
byte byteHex=0;
int.TryParse(charHex,NumberStyles,null,out byteHex);
bytesCharArray[temp]=byteHex;
temp++;
}
}
private void button1_Click(object sender, EventArgs e)
{
string d16="A12164353734573457347D432253254235DA";
string d2="";
foreach ( char d in d16)
{
d2 += Convert.ToString(int.Parse(d.ToString(),System.Globalization.NumberStyles.AllowHexSpecifier),2).PadLeft(4,'0');
}
MessageBox.Show(d2);
}