当前位置: 首页 > news >正文

USB有驱ID卡读卡器C#小程序开发

一:小程序开发环境和视频演示

开发平台: windows 11

先看一下效果:

123

二:小程序基本功能

程序实现基本功能:读卡号 ,让设备发出响声,读出设备唯一编号

读取ID卡卡号:

卡还在感应区内,需要拿起来重新刷:

读取设备唯一序列号:

三:小程序核心代码

namespace idcardreader
{partial class Form1{/// <summary>/// 必需的设计器变量。/// </summary>private System.ComponentModel.IContainer components = null;/// <summary>/// 清理所有正在使用的资源。/// </summary>/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>protected override void Dispose(bool disposing){if (disposing && (components != null)){components.Dispose();}base.Dispose(disposing);}#region Windows 窗体设计器生成的代码/// <summary>/// 设计器支持所需的方法 - 不要/// 使用代码编辑器修改此方法的内容。/// </summary>private void InitializeComponent(){this.button2 = new System.Windows.Forms.Button();this.button4 = new System.Windows.Forms.Button();this.button6 = new System.Windows.Forms.Button();this.button7 = new System.Windows.Forms.Button();this.SuspendLayout();// // button2// this.button2.Location = new System.Drawing.Point(30, 19);this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);this.button2.Name = "button2";this.button2.Size = new System.Drawing.Size(244, 42);this.button2.TabIndex = 1;this.button2.Text = "读卡";this.button2.UseVisualStyleBackColor = true;this.button2.Click += new System.EventHandler(this.button2_Click);// // button4// this.button4.Location = new System.Drawing.Point(294, 19);this.button4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);this.button4.Name = "button4";this.button4.Size = new System.Drawing.Size(325, 42);this.button4.TabIndex = 3;this.button4.Text = "仅读一次,重新取放卡才能读到第二次";this.button4.UseVisualStyleBackColor = true;this.button4.Click += new System.EventHandler(this.button4_Click);// // button6// this.button6.Location = new System.Drawing.Point(30, 153);this.button6.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);this.button6.Name = "button6";this.button6.Size = new System.Drawing.Size(589, 42);this.button6.TabIndex = 5;this.button6.Text = "读出设备全球唯一的设备编号,作为加密狗用";this.button6.UseVisualStyleBackColor = true;this.button6.Click += new System.EventHandler(this.button6_Click);// // button7// this.button7.Location = new System.Drawing.Point(199, 89);this.button7.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);this.button7.Name = "button7";this.button7.Size = new System.Drawing.Size(244, 42);this.button7.TabIndex = 6;this.button7.Text = "让设备发出声响";this.button7.UseVisualStyleBackColor = true;this.button7.Click += new System.EventHandler(this.button7_Click);// // Form1// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.ClientSize = new System.Drawing.Size(645, 221);this.Controls.Add(this.button7);this.Controls.Add(this.button6);this.Controls.Add(this.button4);this.Controls.Add(this.button2);this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);this.Name = "Form1";this.Text = "ID读卡器例子程序";this.Load += new System.EventHandler(this.Form1_Load);this.ResumeLayout(false);}#endregionprivate System.Windows.Forms.Button button2;private System.Windows.Forms.Button button4;private System.Windows.Forms.Button button6;private System.Windows.Forms.Button button7;}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("idcardreader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("idcardreader")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("fb7a443b-4a1c-4c4e-aa9a-5c151fa852a7")]// 程序集的版本信息由下面四个值组成:
//
//      主版本
//      次版本 
//      生成号
//      修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

USB免驱ID读卡器图片

资料下载:USB免驱ID通用读卡器ID-01H (Windows、Android、Linux、Web)_广州荣士电子公司

需要购买这款读卡器的朋友也可以评论区联系我


http://www.mrgr.cn/news/96586.html

相关文章:

  • 哈希表 - 两数之和(Map) - JS
  • 【Kubernetes】CentOS 7 安装 Kubernetes 1.30.1
  • HCIA-数据通信datacom认证
  • Qt使用QGraphicsView绘制线路图————附带详细实现代码
  • 【零基础入门unity游戏开发——2D篇】SpriteRenderer精灵渲染器组件
  • UGNX二次开发——截图功能
  • 蓝桥杯专项复习——二分
  • 将 PyTorch Model 用可视化方法浏览 torchview,onxx, netron, summary | 撰写论文 paper
  • PDF解析黑科技:从OCR-Free到多模态大模型的进化之旅
  • DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加行拖拽排序功能示例14,TableView16_14 拖拽自动保存示例
  • 《异常检测——从经典算法到深度学习》30. 在线服务系统中重复故障的可操作和可解释的故障定位
  • 基于PX4和Ardupilot固件下自定义MAVLink消息测试(QGroundControl和Mission Planner)
  • SQL注入之盲注技术详解
  • DataPlatter:利用最少成本数据提升机器人操控的泛化能力
  • 大模型时代的基础架构 读书笔记
  • Android设计模式之代理模式
  • 项目上传github——SSH连接配置文档
  • 【MySQL】从零开始:掌握MySQL数据库的核心概念(四)
  • 【MySQL】从零开始:掌握MySQL数据库的核心概念(五)
  • Transformer-BiLSTM、Transformer、CNN-BiLSTM、BiLSTM、CNN五模型多变量回归预测