資源簡介
神思二代身份證讀卡程序,利用神思給的c++dll文件進行調用。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Runtime.InteropServices;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?WindowsFormsApplication1.Class;
namespace?WindowsFormsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?message?=?null;
????????????Models.CardModel?model?=?Class.ReadCardInfo.ReadCard(out?message);
????????????if?(message?!=?null)
????????????{
????????????}
????????????else
????????????{
??????????????
????????????}
???????????
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????string?pcmd?=?Char.ConvertFromUtf32(0x41);
????????????string?result?=?Application.StartupPath;
????????????int?arg0?=?0;
????????????int?arg1?=?8811;
????????????byte?[]?arg2?={?0x02?0x27?0x00?0x00?};
????????????//初始化端口
????????????int?flg?=?ReadCardAPI.UCommand1(pcmd?ref?arg0?ref?arg1?arg2);
????????????//驗證卡
????????????pcmd?=?Char.ConvertFromUtf32?(0x43);
????????????int?flg2?=?ReadCardAPI.UCommand1(pcmd?ref?arg0?ref?arg1?arg2);
????????????//讀卡
????????????pcmd?=?Char.ConvertFromUtf32?(0x49);
????????????int?flg3?=?ReadCardAPI.UCommand1(pcmd?ref?arg0?ref?arg1?Encoding.GetEncoding(“GBK“).GetBytes(result));
????????????//讀取識別的身份證信息,并保存到model對象中,方便使用
????????????Models.CardModel?model?=?ReadCardInfo.GetCardInfo();
????????????if?(flg3?==?62171?||?flg3?==?62172?||?flg3?==?62173)
????????????{
????????????}
????????????if?(model?!=?null)
????????????{
????????????????textBox1.Text?=?““;
????????????????string?text?=?string.Format(“姓名:{0}\r\n?性別:{1}\r\n?民族:{2}\r\n?出生日期:{3}\r\n?住址:{4}\r\n?身份證號:{5}“?model.NAME?model.SEX
?????????????????????model.NATION?model.BIRTH?model.ADDRESS?model.IDNO);
????????????????textBox1.Text?=?text;
????????????}
????????}
????}
????public?class?RCard
????{
????????[DllImport(“./DLL/RdCard.dll“)]
????????public?static?extern?int?UCommand1(byte?pCmd?ref?int?arg0?ref?int?parg1?ref?int?parg2);
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-12-04?09:44??.vs\
?????目錄???????????0??2018-12-04?09:44??.vs\WindowsFormsApplication1\
?????目錄???????????0??2018-12-04?10:20??.vs\WindowsFormsApplication1\v14\
?????文件??????105472??2018-12-04?15:03??.vs\WindowsFormsApplication1\v14\.suo
?????文件?????????165??2018-12-04?15:07??readme.txt
?????文件????????1393??2018-12-04?09:52??WindowsFormsApplication1.sln
?????目錄???????????0??2018-12-04?15:03??WindowsFormsApplication1\
?????文件?????????187??2018-12-04?09:44??WindowsFormsApplication1\App.config
?????目錄???????????0??2018-12-04?09:52??WindowsFormsApplication1\bin\
?????目錄???????????0??2018-12-04?14:26??WindowsFormsApplication1\bin\Debug\
?????目錄???????????0??2018-12-04?14:26??WindowsFormsApplication1\bin\Debug\CardInfo\
?????文件??????829264??2018-12-04?09:46??WindowsFormsApplication1\bin\Debug\msvcr100.dll
?????文件??????323072??2018-12-04?09:46??WindowsFormsApplication1\bin\Debug\RdCard.dll
?????文件???????87040??2018-12-04?09:46??WindowsFormsApplication1\bin\Debug\sdtapi.dll
?????文件?????????128??2018-12-04?10:40??WindowsFormsApplication1\bin\Debug\Termb.Lic
?????文件???????45056??2018-12-04?09:46??WindowsFormsApplication1\bin\Debug\unpack.dll
?????文件???????17408??2018-12-04?14:26??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
?????文件?????????187??2018-12-04?09:44??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
?????文件???????40448??2018-12-04?14:26??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
?????文件???????22696??2018-12-04?14:27??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
?????文件?????????187??2018-12-04?09:44??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
?????文件?????????490??2018-04-12?07:35??WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????文件???????67584??2018-12-04?09:46??WindowsFormsApplication1\bin\Debug\WltRS.dll
?????目錄???????????0??2018-12-04?09:52??WindowsFormsApplication1\bin\Release\
?????目錄???????????0??2018-12-04?14:59??WindowsFormsApplication1\bin\x64\
?????目錄???????????0??2018-12-04?14:27??WindowsFormsApplication1\bin\x64\Debug\
?????目錄???????????0??2018-12-04?14:27??WindowsFormsApplication1\bin\x64\Debug\CardInfo\
?????文件????????1024??2018-12-04?14:28??WindowsFormsApplication1\bin\x64\Debug\CardInfofp.bin
?????文件????????1024??2018-12-04?14:28??WindowsFormsApplication1\bin\x64\Debug\CardInfopic.wlt
?????文件?????????135??2018-12-04?14:28??WindowsFormsApplication1\bin\x64\Debug\CardInfowx.txt
?????文件?????????256??2018-12-04?14:28??WindowsFormsApplication1\bin\x64\Debug\CardInfowz.txt
............此處省略68個文件信息
- 上一篇:用C++寫的FTP客戶端
- 下一篇:C++學生成績管理系統( 畢業設計)
評論
共有 條評論