参考:
http://blog.csdn.net/yaogh/article/details/53431469
http://blog.csdn.net/yaogh/article/details/53419392
有没有其他的这俩我都看过了
不晓得是不是这个型号了
protected override void TestProcess()
{
var name = new StringBuilder(31);
var gender = new StringBuilder(3);
var folk = new StringBuilder(10);
var birthDay = new StringBuilder(9);
var code = new StringBuilder(19);
var address = new StringBuilder(71);
var agency = new StringBuilder(31);
var expireStart = new StringBuilder(9);
var expireEnd = new StringBuilder(9);
//char[] param = { '\0' };
//byte[] pMsg = new byte[256];
//string[] baseinfo = new string[9];
int intOpenRet = IdDevice.InitComm(1001);
if (intOpenRet != 1)
{
Console.WriteLine("Open Error.");
IdDevice.CloseComm();
return;
}
var findCard = 0;
var key = new byte[] {0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF};
var buff = new byte[16];
var list = new List<byte>();
do
{
findCard = IdDevice.Routon_IC_FindCard();
} while (findCard==0);
switch (findCard)
{
case 1:
for (var i = 0; i < 4; i++)
{
if (IdDevice.Routon_IC_HL_ReadCard(0, i, 0x60, key, buff) == 1)
list.AddRange(buff);
}
break;
default:
break;
}
Console.WriteLine(list.GetBufferHexString());
//卡认证
//if (intReadRet != 1){ Console.WriteLine("Authenticate Error."); IdDevice.CloseComm();return;}
//ReadBaseInfos(推荐使用)
//for (int i = 0; i < 5; i++)
for (;;)
{
int intReadRet = IdDevice.Authenticate();
if (intReadRet!=1)continue;
int intReadBaseInfosRet = IdDevice.ReadBaseInfos(name, gender, folk, birthDay, code, address, agency,expireStart, expireEnd);
//if (intReadBaseInfosRet != 1)
//{
// //Console.WriteLine("Read Error.");
// //IdDevice.CloseComm();
// //return;
// continue;
//}
Console.WriteLine(intReadBaseInfosRet);
Console.WriteLine(name.ToString());
Console.WriteLine(address.ToString());
//IdDevice.Beep(2047, 200);
}
}
我已经解决了,还是非常感谢,我们做的事B/S的商家给的是C/S的,我联系厂家了,那个demo确实是不能用,他们给我了一个web的demo
我已经解决了,还是非常感谢,我们做的事B/S的商家给的是C/S的,我联系厂家了,那个demo确实是不能用,他们给我了一个web的demo