110,566
社区成员
发帖
与我相关
我的任务
分享
private void buttonX18_Click(object sender, EventArgs e)
{
Card_Read();//二代证进入
}
public void Card_Read()
{
Int32 result;
Int32 port = 0;
UInt32 flag = 0;
try
{
result = Card.OpenCardReader(port, flag);
if (Convert.ToInt32(result) == 0)
{
timer1.Start();
}
else
{
General.meg("打开二代证读取器初始化失败!");
}
}
catch
{
General.meg("二代证读取器初始化失败!");
}
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
Int32 result;
string txt = "";
Card.PERSONINFOW info = new Card.PERSONINFOW();
//txt = Application.StartupPath + "\\imageNew.bmp";
result = Card.GetPersonMsgW(ref info, txt);
if (result == 0)
{
textBoxX4.Text = info.cardId;
buttonX3_Click(sender, e);
timer1.Stop();
Card.CloseCardReader();
}
}
catch
{
General.meg("二代证读取器故障!");
}
}