string hexOutput = "";
char[] values = txtRcv.Text.ToCharArray();
foreach (char letter in values)
{
int value = Convert.ToInt32(letter);
hexOutput += String.Format("{0:X}", value);
}
txtRcv.Text = hexOutput;
我的这段代码已经可以将11转化为16进制的31 31了,我要解决的就是取消点选将十六进制的31 31 转化为11,请帮忙指教,我是这样写的,但是不对
string strOutput = "";
char[] values = txtSend.Text.ToCharArray();
foreach (char letter in values)
{
int value = Convert.ToInt32(letter);
byte[] data = System.BitConverter.GetBytes(value);
strOutput += Encoding.ASCII.GetString(data);
}
txtSend.Text = strOutput;
char[] values = txtRcv.Text.ToCharArray();
foreach (char letter in values)
{
int value = Convert.ToInt32(letter);
hexOutput += String.Format("{0:X}", value);
}
txtRcv.Text = hexOutput;
我的这段代码已经可以将11转化为16进制的31 31了,我要解决的就是取消点选将十六进制的31 31 转化为11,请帮忙指教,我是这样写的,但是不对
string strOutput = "";
char[] values = txtSend.Text.ToCharArray();
foreach (char letter in values)
{
int value = Convert.ToInt32(letter);
byte[] data = System.BitConverter.GetBytes(value);
strOutput += Encoding.ASCII.GetString(data);
}
txtSend.Text = strOutput;