资源简介
创自CRT_310读卡器Demo源码 包含大部分主要的操作,如:进卡、退卡、读磁条、IC卡读卡、APDU发送等等
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CardTest
{
public partial class Form1 : Form
{
int ComFlag = 0;
byte CPUType = 2;
#region DLL
//打开串口
[DllImport(“CRT_310.dll“)]
public static extern int CommOpen(string port);
//关闭串口
[DllImport(“CRT_310.dll“)]
public static extern int CommClose(int ComHandle);
//复位读卡机//0x00=不弹卡 0x01=前端弹卡 0x02=后端弹卡
[DllImport(“CRT_310.dll“)]
public static extern int CRT310_Reset(int ComHandle byte _Eject);
//停卡位置
[DllImport(“CRT_310.dll“)]
public static extern int CRT310_CardPosition(int ComHandle byte _Position);
//移动卡
[DllImport(“CRT_310.dll“)]
public static extern int CRT310_MovePosition(int ComHandle byte _Position);
//进卡控制
[DllImport(“CRT_310.dll“)]
public static extern int CRT310_CardSetting(int ComHandle byte _CardIn byte _EnableBackIn);
//读磁轨数据
[DllImport(“CRT_310.dll“)]
public static extern int MC_ReadTrack(int ComHandle byte _Mode byte _track ref int _TrackDataLen byte[] _TrackData);
//IC卡上电
[DllImport(“CRT_310.dll“)]
public static extern int CRT_IC_CardOpen(int ComHandle);
//IC卡下电
[DllImport(“CRT_310.dll“)]
public static extern int CRT_IC_CardClose(int ComHandle);
//检测IC卡类型
[DllImport(“CRT_310.dll“)]
public static extern int CRT_R_DetectCard(int ComHandle ref char _CardType ref char _CardInfor);
//CPU卡热复位
[DllImport(“CRT_310.dll“)]
public static extern int CPU_WarmReset(int ComHandle ref byte _CPUType byte[] _exData ref int _exdataLen);
//T0卡发送APDU
[DllImport(“CRT_310.dll“)]
public static extern int CPU_T0_C_APDU(int ComHandle int _dataLen byte[] _APDUData byte[] _exData ref int _exdataLen);
//T1卡发送APDU
[DllImport(“CRT_310.dll“)]
public static extern int CPU_T1_C_APDU(int ComHandle int _dataLen byte[] _APDUData byte[] _exData ref int _exdataLen);
#endregion
public Form1()
{
InitializeComponent();
}
private void ShowMessage(string str)//显示信息
{
txtShow.Text += “-------------------------------\r\n“;
txtShow.Text += str + “\r\n“;
txtShow.Selectionstart = txtShow.Text.Length;
panel1.Focus();
}
private void button1_Click(object sender EventArgs e)//打开串口
{
ComFlag = CommOpen(“COM“ + txtCom.Text.Trim());
if (ComFlag != 0)
lblComStatus.Text =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 41984 2018-09-28 15:01 CardTest\.vs\CardTest\v14\.suo
..A..H. 38400 2017-06-16 19:57 CardTest\.vs\CardTest\v15\.suo
I.A.... 184 2018-06-13 10:23 CardTest\CardTest\App.config
I.A.... 38400 2018-07-19 08:04 CardTest\CardTest\bin\Debug\CardTest.exe
I.A.... 184 2018-06-13 10:23 CardTest\CardTest\bin\Debug\CardTest.exe.config
I.A.... 32256 2018-07-19 08:04 CardTest\CardTest\bin\Debug\CardTest.pdb
I.A.... 22696 2018-09-28 15:01 CardTest\CardTest\bin\Debug\CardTest.vshost.exe
I.A.... 184 2018-06-13 10:23 CardTest\CardTest\bin\Debug\CardTest.vshost.exe.config
I.A.... 490 2016-07-16 19:44 CardTest\CardTest\bin\Debug\CardTest.vshost.exe.manifest
I.A.... 102400 2011-11-24 10:05 CardTest\CardTest\bin\Debug\CRT_310.dll
I.A.... 3872 2018-06-13 10:23 CardTest\CardTest\CardTest.csproj
I.A.... 18352 2018-07-19 08:06 CardTest\CardTest\Form1.cs
I.A.... 21792 2018-07-18 11:17 CardTest\CardTest\Form1.Designer.cs
I.A.... 5817 2018-07-18 10:59 CardTest\CardTest\Form1.resx
I.A.... 16958 2017-06-14 16:41 CardTest\CardTest\generic_bank_Credit_Card_64px_559160_easyicon.net.ico
I.A.... 1317 2018-09-28 15:01 CardTest\CardTest\obj\Debug\CardTest.csproj.FileListAbsolute.txt
I.A.... 1012 2018-07-18 11:05 CardTest\CardTest\obj\Debug\CardTest.csproj.GenerateResource.Cache
I.A.... 8563 2018-06-13 10:23 CardTest\CardTest\obj\Debug\CardTest.csprojResolveAssemblyReference.cache
I.A.... 38400 2018-07-19 08:04 CardTest\CardTest\obj\Debug\CardTest.exe
I.A.... 180 2018-07-18 11:05 CardTest\CardTest\obj\Debug\CardTest.Form1.resources
I.A.... 32256 2018-07-19 08:04 CardTest\CardTest\obj\Debug\CardTest.pdb
I.A.... 180 2018-06-13 10:23 CardTest\CardTest\obj\Debug\CardTest.Properties.Resources.resources
I.A.... 42 2017-06-14 16:09 CardTest\CardTest\obj\Debug\CoreCompileInputs.cache
I.A.... 1760 2018-06-13 10:24 CardTest\CardTest\obj\Debug\DesignTimeResolveAssemblyReferences.cache
I.A.... 6975 2018-09-28 15:01 CardTest\CardTest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
I.A.... 0 2017-06-14 16:09 CardTest\CardTest\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
I.A.... 0 2017-06-14 16:09 CardTest\CardTest\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
I.A.... 0 2017-06-14 16:09 CardTest\CardTest\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
I.A.... 3584 2018-06-13 10:24 CardTest\CardTest\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
I.A.... 520 2017-06-14 16:09 CardTest\CardTest\Program.cs
............此处省略21个文件信息
- 上一篇:蛐蛐旧版本1.0.0.1
- 下一篇:2017最新游戏支付平台程序
相关资源
- 易语言取微云数据V1源码易语言取微云
- 易语言Excel多表对应处理源码
- 易语言取word打开、另存为对话框窗口
- 易语言EXCEL另存为CSV文件源码
- delphi百度地图源码
- 易语言EMS快递查询源码
- 易语言快递查询源码
- 易语言查询79种快递源码
- SecureCRT v7.0 注册机
- SecureCRT-6.0.2安装包和SecureCRT-6.0.2注册
- 易语言搜搜mp3源码
- 易语言迅雷补丁源码
- 易语言高仿迅雷5安装包源码
- bootstrap demo 源码大全
- springboot整合RabbitMQ实现延时队列的两
- 关于Spring MVC项目maven中通过fileupload上
- 新一代Lora芯片sx126x的驱动源码
- SecureCRT 非常好用的串口工具
- 串口调试工具 SecureCRT
- win7超级终端SecureCRT
- 易语言版迅雷视频转换器源码
- 今日头条源码.zip
- CtrlAltQ全屏截图源码
- 易语言全屏截图源码
- 百度图片识别源码.rar
- 易语言穿越火线辅助程序源码
- WINDOWS内核安全编程 寒江独钓 光盘源
- 寒江独钓-Windows内核安全编程(完整版
- DevExpress 15.1.6 源码 全 百度云
- 很久以前的MUD游戏源码和mudos
评论
共有 条评论