嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
C#调用华视电子身份证扫描仪
private void readcard()
{
//String s = Application.StartupPath;
int a = 0;
a = InitCommExt();
if (a == 0)
{
MessageBox.Show("初始化端口失败!");
CloseComm();
return;
}
int b = 0;
b = Authenticate();
if (b != 1)
{
//MessageBox.Show("卡认证失败!");
CloseComm();
return;
}
int c;
c = Read_Content(1);
if (c != 1)
{
//MessageBox.Show("读卡失败!");
CloseComm();
return;
}
CloseComm();
//MessageBox.Show("读卡成功");
timerLock = 0;
pictureBox1.ImageLocation = Application.StartupPath "\\zp.bmp";
StreamReader sr = new StreamReader(Application.StartupPath "\\wz.txt", Encoding.Unicode);
string temp = "";
try
{
temp = sr.ReadLine();
this.Text = temp.Length.ToString();
txtResult.AppendText("姓名:" temp.Substring(0, 15).Trim() "\n");
txtResult.AppendText("性别:" temp.Substring(15, 1).Trim() "\n");
txtResult.AppendText("民族:" temp.Substring(16, 2).Trim() "\n");
txtResult.AppendText("出生:" temp.Substring(18, 8).Trim() "\n");
txtResult.AppendText("住址:" temp.Substring(26, 35).Trim() "\n");
txtResult.AppendText("公民身份号码:" temp.Substring(61, 18).Trim() "\n");
txtResult.AppendText("签发机关:" temp.Substring(79, 15).Trim() "\n");
txtResult.AppendText("有效期起始日期:" temp.Substring(94, 8).Trim() "\n");
txtResult.AppendText("有效期截止日期:" temp.Substring(102, 8).Trim() "\n");
txtResult.AppendText("最新住址:" temp.Substring(110, 35).Trim() "\n");
txtResult.AppendText(temp);
}
catch
{
}
sr.Close();
}