IC卡读写器c#源代码

 

 

 

 

 

 

读卡器使用软件界面图

如需定制请联系 广州荣士电子有限公司  电话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单位为毫秒

  //------------------------------------------------------------------------------------------------------------------------------------------------------   
  //读取设备编号,可做为软件加密狗用,也可以根据此编号在公司网站上查询保修期

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值