嗨,伙计们,我想从 ascii 代码转换为普通代码,因为我做了一个从普通代码转换为 ascii 代码的方法,我想将其反转,这是我转换为 ascii 的方法
public string CreatSerial()
{
string serial = "";
string P1, P2 = "";
string Befor_Serial = GetDeviceSerial().Trim() + 5;
P1 = Befor_Serial.Substring(0, Befor_Serial.Length / 2);
P2 = Befor_Serial.Substring(Befor_Serial.Length / 2);
Befor_Serial = P2 + "ICS" + P1;
char[] strarr = Befor_Serial.ToCharArray();
Array.Reverse(strarr);
serial = new string(strarr);
byte[] asciiBytes = Encoding.ASCII.GetBytes(serial);
serial = "";
foreach (byte b in asciiBytes)
{
serial += b.ToString();
}
return serial;
}