資源簡介
神思ss628型USB二代身份證讀卡器的調用源碼

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
namespace?ReadIDCardApplicationVS5
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????///?
????????///?讀取身份證信息
????????///?
????????///?
????????///?
????????private?void?btnRead_Click(object?sender?EventArgs?e)
????????{
????????????string?sMsg?=?string.Empty;
????????????//初始化
????????????if?(!IDCardReader.InitCom(0?out?sMsg))
????????????{
????????????????MessageBox.Show(sMsg);
????????????}
????????????//發布后的運行路勁,發布的是Release版本的
????????????string?sPath?=?System.Environment.CurrentDirectory.Substring(0?System.Environment.CurrentDirectory.LastIndexOf(‘\\‘));?//
????????????sPath?=?System.Environment.CurrentDirectory?+?“\\“;
????????????//MessageBox.Show(sPath);
????????????//未發布的程序運行路勁
#if?DEBUG
????????????sPath?=?System.Windows.Forms.Application.StartupPath;
#endif
????????????CardInfo?objIDCardInfo?=?null;
????????????try
????????????{
????????????????//讀身份證對象
????????????????objIDCardInfo?=?IDCardReader.ReadCardInfo(0?out?sMsg?sPath);
????????????????if?(!string.IsNullOrEmpty(sMsg))
????????????????????MessageBox.Show(sMsg);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????MessageBox.Show(ex.Message?“系統提示“);
????????????}
????????????if?(objIDCardInfo?!=?null)
????????????{
????????????????//賦值
????????????????txtIDCard.Text?=?objIDCardInfo.CardNo;
????????????????txtName1.Text?=?objIDCardInfo.Name;
????????????????txtSex1.Text?=?objIDCardInfo.Sex;
????????????????txtBirthday1.Text?=?objIDCardInfo.Birthday;
????????????????txtStartDate1.Text?=?objIDCardInfo.StartDate;
????????????????txtEndDate1.Text?=?objIDCardInfo.EndDate;
????????????????txtNation1.Text?=?objIDCardInfo.Nation;
????????????????txtAddress1.Text?=?objIDCardInfo.Address;
????????????????System.IO.MemoryStream?objMSPhoto?=?new?System.IO.MemoryStream(objIDCardInfo.ArrPhotoByte?0?objIDCardInfo.ArrPhotoByte.Length);
????????????????Image?objImage?=?Image.FromStream(objMSPhoto);
????????????????this.panel1.BackgroundImage?=?objImage;
????????????}
????????}
????????///?
????????///?清空身份證信息
????????///?
????????///?
????????///?
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????txtIDCard.Text?=?string.Empty;
????????????txtName1.Text?=?string.Empty;
????????????txtSex1.Text?=?string.Empty;
????????????txtBirthday1.Text?=?string.Empty;
????????????txtStartDate1.Text?=?string.Empty;
????????????txtEndDate1.Text?=?string.Empty;
????????????txtNation1.Text?=?string.Empty;
????????????txtAddress1.Text?=?string.Empty;
????????????this.pa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-04-07?10:59??Backup\
?????目錄???????????0??2013-04-07?10:59??Backup\ReadIDCardApplicationVS5\
?????文件???????29534??2010-08-24?08:55??Backup\ReadIDCardApplicationVS5\Form1.Designer.cs
?????文件????????3164??2010-08-24?10:04??Backup\ReadIDCardApplicationVS5\Form1.cs
?????文件????????5814??2010-08-24?08:55??Backup\ReadIDCardApplicationVS5\Form1.resx
?????文件????????9978??2010-08-27?17:47??Backup\ReadIDCardApplicationVS5\IDCardReader.cs
?????文件?????????483??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Program.cs
?????目錄???????????0??2013-04-07?10:59??Backup\ReadIDCardApplicationVS5\Properties\
?????文件????????1220??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Properties\AssemblyInfo.cs
?????文件????????2904??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Properties\Resources.Designer.cs
?????文件????????5612??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Properties\Resources.resx
?????文件????????1109??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Properties\Settings.Designer.cs
?????文件?????????249??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5\Properties\Settings.settings
?????文件???????36864??2010-08-23?10:36??Backup\ReadIDCardApplicationVS5\RdCard.dll
?????文件????????4946??2010-08-27?00:08??Backup\ReadIDCardApplicationVS5\ReadIDCardApplicationVS5.csproj
?????文件?????????651??2010-08-24?10:04??Backup\ReadIDCardApplicationVS5\ReadIDCardApplicationVS5.csproj.user
?????文件????????1668??2010-08-24?09:02??Backup\ReadIDCardApplicationVS5\ReadIDCardApplicationVS5_TemporaryKey.pfx
?????文件???????90112??2010-08-23?10:36??Backup\ReadIDCardApplicationVS5\WltRS.dll
?????文件???????65536??2010-08-23?10:36??Backup\ReadIDCardApplicationVS5\sdtapi.dll
?????文件?????????961??2010-08-24?08:43??Backup\ReadIDCardApplicationVS5.sln
?????文件???????20480??2010-08-27?15:18??Backup\ReadIDCardApplicationVS5.suo
- 上一篇:C#電影院售票系統
- 下一篇:c#五子棋游戲開發論文
評論
共有 條評論