string sBarcodeHex; //十六进制
string sBarcodeAscii=""; //条码返回ASCII字符串
sBarcodeHex=Info.ToString();
//当条码值为空时不处理
if ((sBarcodeHex.Length) > 0)
{
int i = 0;
string cAscii;
while (i < sBarcodeHex.Length)
{
if (sBarcodeHex.Length >= i + 2)
cAscii = sBarcodeHex.Substring(i, 2);
else
cAscii = sBarcodeHex.Substring(i, 1);
int value = Convert.ToInt32(cAscii, 16);
char charValue = (char)value;
sBarcodeAscii = sBarcodeAscii + charValue.ToString();
i = i + 2;
}
Info = sBarcodeAscii;
}
else
{
Info = "空";
}
Dsp1 = "条码输入:";
Dsp2 = Info;
string sBarcodeAscii=""; //条码返回ASCII字符串
sBarcodeHex=Info.ToString();
//当条码值为空时不处理
if ((sBarcodeHex.Length) > 0)
{
int i = 0;
string cAscii;
while (i < sBarcodeHex.Length)
{
if (sBarcodeHex.Length >= i + 2)
cAscii = sBarcodeHex.Substring(i, 2);
else
cAscii = sBarcodeHex.Substring(i, 1);
int value = Convert.ToInt32(cAscii, 16);
char charValue = (char)value;
sBarcodeAscii = sBarcodeAscii + charValue.ToString();
i = i + 2;
}
Info = sBarcodeAscii;
}
else
{
Info = "空";
}
Dsp1 = "条码输入:";
Dsp2 = Info;