资源简介
精伦台式具名身份证阅读器机具IDR210,包含IDR210C#源代码
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Uselndll
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport(“Sdtapi.dll“)]
private static extern int InitComm(int iPort);
[DllImport(“Sdtapi.dll“)]
private static extern int Authenticate();
[DllImport(“Sdtapi.dll“)]
private static extern int ReadbaseInfos(StringBuilder Name StringBuilder Gender StringBuilder Folk
StringBuilder BirthDay StringBuilder Code StringBuilder Address
StringBuilder Agency StringBuilder ExpireStart StringBuilder ExpireEnd);
[DllImport(“Sdtapi.dll“)]
private static extern int CloseComm();
[DllImport(“Sdtapi.dll“)]
private static extern int ReadbaseMsg(byte[] pMsg ref int len);
[DllImport(“Sdtapi.dll“)]
private static extern int ReadbaseMsgW(byte[] pMsg ref int len);
private void button1_Click(object sender EventArgs e)
{
StringBuilder Name = new StringBuilder(31);
StringBuilder Gender = new StringBuilder(3);
StringBuilder Folk = new StringBuilder(10);
StringBuilder BirthDay = new StringBuilder(9);
StringBuilder Code = new StringBuilder(19);
StringBuilder Address = new StringBuilder(71);
StringBuilder Agency = new StringBuilder(31);
StringBuilder ExpireStart = new StringBuilder(9);
StringBuilder ExpireEnd = new StringBuilder(9);
byte[] pMsg = new byte[256];
int len = 0;
string[] temp;
string[] baseinfo = new string[9];
char[] param = { ‘\0‘ };
//打开端口
int intOpenRet = InitComm(1001);
if (intOpenRet != 1)
{
MessageBox.Show(“阅读机具未连接“);
return;
}
//卡认证
int intReadRet = Authenticate();
if (intReadRet != 1)
{
MessageBox.Show(“卡认证失败“);
CloseComm();
return;
}
//三种方式读取基本信息
//ReadbaseInfos(推荐使用)
int intReadbaseInfosRet = ReadbaseInfos( Name Gender Folk BirthDay Code Address Agency ExpireStart ExpireEnd);
if (intReadbaseInfosRet != 1)
{
MessageBox.Show(“读卡失败“);
CloseComm();
return;
}
label4.Text = Code.ToString();
label6.Text = Name.ToString();
label8.Text = Gender.ToString();
label10.Text = Fo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-01-03 22:38 IDR210\
目录 0 2016-01-03 22:41 IDR210\C#\
文件 3040 2007-07-09 16:32 IDR210\C#\Byte数组转化为string-相关知识.txt
文件 671 2007-07-09 16:33 IDR210\C#\Encoding.UTF8.GetString.txt
文件 4983 2016-01-03 22:39 IDR210\C#\UpgradeLog.xm
目录 0 2016-01-03 22:38 IDR210\C#\Uselndll\
文件 12110 2007-07-10 16:04 IDR210\C#\Uselndll\Form1.Designer.cs
文件 5350 2007-07-10 16:04 IDR210\C#\Uselndll\Form1.cs
文件 5814 2007-07-10 16:04 IDR210\C#\Uselndll\Form1.resx
文件 467 2007-06-20 09:29 IDR210\C#\Uselndll\Program.cs
目录 0 2016-01-03 22:38 IDR210\C#\Uselndll\Properties\
文件 1168 2007-06-20 09:29 IDR210\C#\Uselndll\Properties\AssemblyInfo.cs
文件 2855 2016-01-03 22:39 IDR210\C#\Uselndll\Properties\Resources.Designer.cs
文件 5612 2007-06-20 09:29 IDR210\C#\Uselndll\Properties\Resources.resx
文件 1107 2016-01-03 22:39 IDR210\C#\Uselndll\Properties\Settings.Designer.cs
文件 249 2007-06-20 09:29 IDR210\C#\Uselndll\Properties\Settings.settings
文件 655 2007-07-10 14:54 IDR210\C#\Uselndll\Properties\app.manifest
文件 5891 2016-01-03 22:39 IDR210\C#\Uselndll\Uselndll.csproj
文件 576 2016-01-03 22:39 IDR210\C#\Uselndll\Uselndll.csproj.user
文件 1652 2007-07-10 14:54 IDR210\C#\Uselndll\Uselndll_TemporaryKey.pfx
目录 0 2016-01-03 22:38 IDR210\C#\Uselndll\bin\
目录 0 2016-01-03 22:38 IDR210\C#\Uselndll\bin\Debug\
文件 5632 2005-12-08 14:51 IDR210\C#\Uselndll\bin\Debug\Uselndll.vshost.exe
文件 57344 2006-11-15 09:34 IDR210\C#\Uselndll\bin\Debug\sdtapi.dll
文件 90112 2006-11-15 09:34 IDR210\C#\Uselndll\bin\Debug\wltrs.dll
目录 0 2016-01-03 22:39 IDR210\C#\Uselndll\bin\Release\
文件 221184 2007-03-12 15:58 IDR210\C#\Uselndll\bin\Release\Dewlt.dll
文件 335360 2011-06-02 10:35 IDR210\C#\Uselndll\bin\Release\JpgDll.dll
文件 3129856 2011-05-20 11:11 IDR210\C#\Uselndll\bin\Release\SavePhoto.dll
文件 1841 2016-01-03 22:39 IDR210\C#\Uselndll\bin\Release\Uselndll.application
文件 11776 2016-01-03 22:39 IDR210\C#\Uselndll\bin\Release\Uselndll.exe
............此处省略33个文件信息
- 上一篇:C# C/s项目源码
- 下一篇:Unity2D小游戏——炸弹人类似qq堂的小demo
评论
共有 条评论