风痕之月 - API
type: channel
link: https://www.helj.top/index.php/category/API/
items: CV300EAPI
items: ViKeyAPI
items: ET99API

CV300EAPI
type: item
date: 2018-09-30T16:03:30+08:00
description: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Helper { public class CV300EHelper { #region 指纹特征提取函数接口 /// /// 版本信息获取 /// 函数原型：int __stdcall FP_GetVersion(unsigned char code[4]) /// /// unsigned char code[4] 版本信息格式为XXYY，XX为开发者代码，YY为版本号。如“1201” 则code的填写方式为：，code[0]=‘1’ code[1]=，‘2’ code[3]=，‘0’ code[4]=,‘1’。输出参数。 /// <returns>调用成功，返回1；否则返回错误代码，错误代码值应符合B.4的要求。输出参数。</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_GetVersion", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_GetVersion(System.IntPtr code); /// /// 初始化操作 /// 函数原型：int __stdcall FP_Begin() /// /// <returns>调用成功返回 1。否则返回错误代码，调用 LIVESCAN_GetErrInfo 函数获取错误信息。错误代码值符合 B.4 的要求。</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_Begin", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_Begin(); /// /// 指纹图像特征提取 /// 函数原型：int __stdcall FP_FeatureExtract(unsigned char cScannerType,unsigned char cFingerCode,unsigned char * pFingerImgBuf,unsigned char * pFeatureData) /// /// unsigned char cScannerType 指纹采集器代码。输入参数。 /// unsigned char cFingerCode 指位代码。输入参数。 /// unsigned char * pFingerImgBuf 指纹图像数据指针，指纹图像为RAW格式。输入参数。 /// unsigned char * pFeatureData 指纹特征数据指针，存储生成的指纹特征数据，由调用者分配内存空间，输出参数。 /// <returns>调用成功，返回1；否则返回错误代码，错误代码值应符合B.4的要求</returns> [DllImport("ID_Fpr.dll", EntryPoint = "FP_FeatureExtract", CharSet = CharSet.Auto, SetLastError = false)] public static extern int FP_FeatureExtract(byte cScannerType, byte cFingerCode, System.IntPtr pFingerImgBuf, System.IntPtr pFeatureData); /// /// 指纹图像数据与指纹特征数据比对 /// 函数原型：int __stdcall FP_FeatureMatch(unsigned char * pFeatureData1,unsigned char* pFeatureData2,float * pfSimilarity) /// 对两个指纹特征数据进行比对，得到相似度值 /// /// unsigned char * pFeatureData1 指纹特征数据指针1。输入参数。 /// unsigned char * pFeatureData2 指纹特征数据指针2。输入参数。 /// float * pfSimilarity 相似度，取值范围为0…

ViKeyAPI
type: item
date: 2018-09-30T15:49:00+08:00
description: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Helper { public class ViKeyAPI { public const string DefaultUserPassword = "11111111"; public const string DefaultAdminPassword = "00000000"; // 错误代码 public const long VIKEY_SUCCESS = 0x00000000; //成功 public const long VIKEY_ERROR_NO_VIKEY = 0x80000001; //没有找到ViKey加密锁 public const long VIKEY_ERROR_INVALID_PASSWORD = 0x80000002; //密码错误 public const long VIKEY_ERROR_NEED_FIND = 0x80000003; //请先查找加密锁 public const long VIKEY_ERROR_INVALID_INDEX = 0x80000004; //无效的句柄 public const long VIKEY_ERROR_INVALID_VALUE = 0x80000005; //数值错误 public const long VIKEY_ERROR_INVALID_KEY = 0x80000006; //秘钥无效 public const long VIKEY_ERROR_GET_VALUE = 0x80000007; //读取信息错误 public const long VIKEY_ERROR_SET_VALUE = 0x80000008; //设置信息错误 public const long VIKEY_ERROR_NO_CHANCE = 0x80000009; //没有机会 public const long VIKEY_ERROR_NO_TAUTHORITY = 0x8000000A; //权限不足 public const long VIKEY_ERROR_INVALID_ADDR_OR_SIZE = 0x8000000B; //地址或长度错误 public const long VIKEY_ERROR_RANDOM = 0x8000000C; //获取随机数错误 public const long VIKEY_ERROR_SEED = 0x8000000D; //获取种子错误 public const long VIKEY_ERROR_CONNECTION = 0x8000000E; //通信错误 public const long VIKEY_ERROR_CALCULATE = 0x8000000F; //算法或计算错误 public const long VIKEY_ERROR_MODULE = 0x80000010; //计数器错误 public const long VIKEY_ERROR_GENERATE_NEW_PASSWORD = 0x80000011; //产生密码错误 public const long VIKEY_ERROR_ENCRYPT_FAILED = 0x80000012; //加密数据错误 public const long VIKEY_ERROR_DECRYPT_FAILED = 0x80000013; //解密数据错误 public const long VIKEY_ERROR_ALREADY_LOCKED = 0x80000014; //ViKey加密锁已经被锁定 public const long VIKEY_ERROR_UNKNOWN_COMMAND = 0x80000015; //无效的命令 public const long VIKEY_ERROR_UNKNOWN_ERROR = 0xFFFFFFFF; //未知错误 //ViKey加密狗类型 VikeyGetType返回值代表的类型 public const uint ViKeyAPP = 0; //实用型加密狗ViKeyAPP public const uint ViKeySTD = 1; //标准型加密狗ViKeySTD public const uint ViKeyNET = 2; //网络型加密狗ViKeyNET public con…

ET99API
type: item
date: 2018-09-30T15:49:00+08:00
description: using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace API { public static class ET99_API { #region 常量 /// /// 函数执行成功 /// public const int ET_SUCCESS = 0x00; /// /// 访问被拒绝，权限不够 /// public const int ET_ACCESS_DENY = 0x01; /// /// 通讯错误，没有打开设备 /// public const int ET_COMMUNICATIONS_ERROR = 0x02; /// /// 无效的参数，参数出错 /// public const int ET_INVALID_PARAMETER = 0x03; /// /// 没有设置 PID /// public const int ET_NOT_SET_PID = 0x04; /// /// 打开指定的设备失败 /// public const int ET_UNIT_NOT_FOUND = 0x05; /// /// 硬件错误 /// public const int ET_HARD_ERROR = 0x06; /// /// 未知错误 /// public const int ET_UNKNOWN_ERROR = 0x07; /// /// 验证 PIN码掩码 /// public const int ET_PIN_ERR_MASK = 0x0F; /// /// 验证 PIN码,设备被锁定 /// public const int ET_PIN_ERR_LOCKED = 0xF0; /// /// 验证 PIN码错误且永远不锁死 /// public const int ET_PIN_ERR_MAX = 0xFF; /// /// 表示验证普通用户 pin /// public const int ET_VERIFY_USERPIN = 0; /// /// 表示验证超级用户 pin /// public const int ET_VERIFY_SOPIN = 1; /// /// 表示数据区可读写 /// public const int ET_USER_WRITE_READ = 0; /// /// 表示数据区只允许读 /// public const int ET_USER_READ_ONLY = 1; /// /// 常量 PID,默认的产品PID /// public const string CONST_PID = "ffffffff"; #endregion /// /// 根据错误码显示错误提示内容 /// /// public static string ShowResultText(uint result) { switch (result) { case (ET_SUCCESS): { return "操作成功！"; } case (ET_ACCESS_DENY): { return "访问被拒绝，权限不够！"; } case (ET_COMMUNICATIONS_ERROR): { return "通讯错误，没有打开设备 ！"; } case (ET_INVALID_PARAMETER): { return "无效的参数，参数出错 ！"; } case (ET_NOT_SET_PID): { return "没有设置 PID ！"; } case (ET_UNIT_NOT_FOUND): { return "打开指定的设备失败！"; } case (ET_HARD_ERROR): { return "硬件错误！"; } case (ET_UNKNOWN_ERROR): { return "未知错误！"; } case (ET_PIN_ERR_MAX): { return "PIN码错误！请核实。"; } case (ET_PIN_ERR_LOCKED): { return "PIN码错误！设备已经被锁死。"; } } //输出剩余PIN验证次数 if (result > ET_PIN_ERR_LOCKED && result < ET_PIN_ERR_MAX) { return "PIN码验证错误！剩余重试次数：" + (result - ET_PIN_ERR_LOCKED).ToString(); } return "未知代码！"; } /// /// 查找计算机上指定 pid 的 ET99 个数。 /// /// […