读卡器使用软件界面图
如需定制请联系 广州荣士电子有限公司 电话13826029618 13242318979 公司网址http://www.icmcu.com
详细代码如下:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices; //调用动态库一定要加入这个引用
//广州荣士电子有限公司,联系电话020-82318861,82322852,定制13826029618 网址http://www.icmcu.com
namespace iccardreader
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
//常量定义
public const byte BLOCK0_EN = 0x01;//操作第0块
public const byte BLOCK1_EN = 0x02;//操作第1块
public const byte BLOCK2_EN = 0x04;//操作第2块
public const byte NEEDSERIAL = 0x08;//仅对指定序列号的卡操作
public const byte EXTERNKEY = 0x10;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button6;//用函数参数中的密码组进行读写卡时的认证,而不是用藏于读写器的芯片内的密码来认证。
public const byte NEEDHALT = 0x20;//读卡或写卡后顺便休眠该卡,休眠后,卡必须拿离开感应区,再放回感应区,才能进行第二次操作。
//------------------------------------------------------------------------------------------------------------------------------------------------------
//外部函数声明:让设备发出声响
[DllImport("OUR_MIFARE.dll", EntryPoint = "pcdbeep")]
static extern byte pcdbeep(ulong xms);//xms单位为毫秒
//------------------------------------------------------------------------------------------------------------------------------------------------------
//读取设备编号,可做为软件加密狗用,也可以根据此编号在公司网站上查询保修期