我的卡是4428卡。
public int check_IC4428MiMa(string shuju)
{
if (shuju.Length == 4)
{
byte[] input = Encoding.ASCII.GetBytes(shuju);
byte[] output = new byte[2];
int st = IC.asc_hex(input, output, 2);
st = IC4428.csc_4428(icdev, 2, output);
return st;
}
else
{
MessageBox.Show("密码长度不正确,密码长度应为4");
return -1;
}
}无论密码是对是错,只要执行这句话IC4428.csc_4428(icdev, 2, output);
返回值都是0.也就是说都认为密码是正确的,这是为什么啊
public int check_IC4428MiMa(string shuju)
{
if (shuju.Length == 4)
{
byte[] input = Encoding.ASCII.GetBytes(shuju);
byte[] output = new byte[2];
int st = IC.asc_hex(input, output, 2);
st = IC4428.csc_4428(icdev, 2, output);
return st;
}
else
{
MessageBox.Show("密码长度不正确,密码长度应为4");
return -1;
}
}无论密码是对是错,只要执行这句话IC4428.csc_4428(icdev, 2, output);
返回值都是0.也就是说都认为密码是正确的,这是为什么啊
明华自带的DEMO.exe测试程序运行时也是可以的。就是自己编写的不行。