资源简介
关于c# 的 usbkey开发代码,包含验证pin码,写入 读出文件等方法
代码片段和文件信息
using System;
using System.Text;
using System.Runtime.InteropServices;
public class read{
public struct WFileInfo
{
public uint lID;
public uint lFlags;
public uint lFileSize;
public byte ucFileType;
public byte ucReadAccess;
public byte ucWriteAccess;
public byte ucDeleteAccess;
public byte ucCryptAccess;
public byte ucReserved1;
public byte ucReserved12;
public byte ucReserved13;
public int ucReserved14;
public int ucReserved15;
public byte ucGrantedAccess;
public byte ucReserved2;
public byte ucReserved22;
public byte ucReserved23;
public int ucReserved24;
public int ucReserved25;
public int ucReserved26;
public int ucReserved27;
}
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_CreateContext(out IntPtr hContextHandle uint ulFlags uint ulApiVersion);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_OpenDevice(IntPtr hContextHandle uint ulQueryType IntPtr pQueryData);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_Verify(IntPtr hContextHandle uint ulFlagsbyte[] pucData uint ulSize);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_CloseDevice(IntPtr hContextHandle);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_DeleteContext(IntPtr hContextHandle);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_OpenFile(IntPtr hContextHandle uint ulFlags uint ulFileID ref WFileInfo pFileInfo uint ulSizeOfFileInfo);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_Write(IntPtr hContextHandle uint ulFlags uint ulOffset byte[] pucBuffer uint ulBytesToWrite out uint pulBytesWritten);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_Read(IntPtr hContextHandle uint ulFlags uint ulOffset byte[] pucBuffer uint ulBytesToRead out uint pulBytesRead);
[DllImport(“FT_ND_API.dll“)]
public static extern uint epas_CloseFile(IntPtr hContextHandle);
[STAThread]
public static void Main(string[] args){
IntPtr g_hToken = IntPtr.Zero;
uint retval = 0;
byte [] uPin=Encoding.Default.GetBytes(“1234“);
System.Console.WriteLine(“test verify “);
retval = epas_CreateContext(out g_hToken 0 0x100);
if (retval == 0)
{
System.Console.WriteLine(“CreateContext OK“);
}
else
{
System.Console.WriteLine(“CreateContext error {0:X8}“retval);
goto Exit;
}
retval = epas_OpenDevice(g_hToken 0x001
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2314 2010-08-31 11:24 verify1.cs
文件 4804 2010-08-31 13:19 read.cs
----------- --------- ---------- ----- ----
7118 2
相关资源
- wifirobot C#上位机
- C# 局域网聊天程序 一个服务器多个客
- C#断点续传包含客户端、服务器端代码
- .net(C#)用户登陆自定义控件
- C#循环队列
- asp.net 站内邮件系统c#
- xmodem通讯协议c#源码全网独一份绝对值
- c#实现u盘操作程序,可进行对u盘的感
- Modbus串口通信
- 旅游网站毕业论文
- c#WinForm程序自动升级源码
- 《ArcGIS Engine+C#开发教程》
- c#文件自动备份程序
- 精美时钟()
- NTKO OFFICE 4.0.3.2--完美破解+WinformDemo[
- C#小型窗体项目-BMI计算器
- C#实现本机资源监控
- C#微秒级计时器
- c#+SQL server物资管理系统
- c#gps原代码
- C#绘图工具DrawTools2005
- C#界面分屏展示
- ArcGis Engine + C# + 最短路径算法
- c#实现录wav音频
- C#中主窗体Panel中加载其他多个窗体
- c#进销存管理系统源码
- C#上位机控制WiFi智能小车
- C_序列化和反序列化.pdf
- c#实战程序:图片配对游戏
- c#实战:利用c#开扫雷游戏代码
评论
共有 条评论