SDK开发包怎么使
小弟在做一个Winform下的项目,其中用到了第二代身份证阅读器,品牌是“国腾GTICR100二代证”。。。
打开它的SDK,里面有“开发包”、“驱动包”、“样例源码”、和“函数包”使用手册,以及VB/VC/Deliphi的软件案例。。。ca,没有C#的。。。
看看它的开发包:
只有四个文件:termb.dll、WltRS.dll、gbk2gb13000、Nation.dat。。。
应该是把“termb.dll、WltRS.dll”在开发应用的时候添加进去就好了对吧。。。
C#的实力竟然是个“控制台程序”,而且只有读姓名和性别,不想其它VB/VC/Delephy的,什么都读出来了,而且是Winform下。。。
C#实例:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int InitComm(int iPort);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int CloseComm();
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int Authenticate();
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int Read_Content(int iActive);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleName(Byte[] buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleSex(Byte[] buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleNation(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleBirthday(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleAddress(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetStartDate(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetEndDate(StringBuilder buf, int iLen);
static string GetName()
{
Byte[] asciiBytes = null;
asciiBytes = new Byte[100];
int dwRet = GetPeopleName(asciiBytes, 100);
Encoding gb2312 = Encoding.GetEncoding("gb2312");
char[] asciiChars = new char[gb2312.GetCharCount(asciiBytes, 0, dwRet)];
gb2312.GetChars(asciiBytes, 0, dwRet, asciiChars, 0);
return new string(asciiChars);
}
static string GetSex()
{
Byte[] asciiBytes = null;
asciiBytes = new Byte[100];
int dwRet = GetPeopleSex(asciiBytes, 100);
Encoding gb2312 = Encoding.GetEncoding("gb2312");
char[] asciiChars = new char[gb2312.GetCharCount(asciiBytes, 0, dwRet)];
gb2312.GetChars(asciiBytes, 0, dwRet, asciiChars, 0);
return new string(asciiChars);
}
static void Main(string[] args)
{
int i = InitComm(1);
i = Authenticate();
i = Read_Content(1);
string szValue = null;
szValue = GetName();
szValue = GetSex();
Console.Read();
}
}
}
小弟要把它改为Winform下的程序,请问照片应该怎样读???方法怎样写???
不太擅闯API啊。。。
打开它的SDK,里面有“开发包”、“驱动包”、“样例源码”、和“函数包”使用手册,以及VB/VC/Deliphi的软件案例。。。ca,没有C#的。。。
看看它的开发包:
只有四个文件:termb.dll、WltRS.dll、gbk2gb13000、Nation.dat。。。
应该是把“termb.dll、WltRS.dll”在开发应用的时候添加进去就好了对吧。。。
C#的实力竟然是个“控制台程序”,而且只有读姓名和性别,不想其它VB/VC/Delephy的,什么都读出来了,而且是Winform下。。。
C#实例:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int InitComm(int iPort);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int CloseComm();
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int Authenticate();
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int Read_Content(int iActive);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleName(Byte[] buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleSex(Byte[] buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleNation(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleBirthday(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetPeopleAddress(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetStartDate(StringBuilder buf, int iLen);
[DllImport("termb.DLL", CallingConvention = CallingConvention.StdCall)]
public static extern int GetEndDate(StringBuilder buf, int iLen);
static string GetName()
{
Byte[] asciiBytes = null;
asciiBytes = new Byte[100];
int dwRet = GetPeopleName(asciiBytes, 100);
Encoding gb2312 = Encoding.GetEncoding("gb2312");
char[] asciiChars = new char[gb2312.GetCharCount(asciiBytes, 0, dwRet)];
gb2312.GetChars(asciiBytes, 0, dwRet, asciiChars, 0);
return new string(asciiChars);
}
static string GetSex()
{
Byte[] asciiBytes = null;
asciiBytes = new Byte[100];
int dwRet = GetPeopleSex(asciiBytes, 100);
Encoding gb2312 = Encoding.GetEncoding("gb2312");
char[] asciiChars = new char[gb2312.GetCharCount(asciiBytes, 0, dwRet)];
gb2312.GetChars(asciiBytes, 0, dwRet, asciiChars, 0);
return new string(asciiChars);
}
static void Main(string[] args)
{
int i = InitComm(1);
i = Authenticate();
i = Read_Content(1);
string szValue = null;
szValue = GetName();
szValue = GetSex();
Console.Read();
}
}
}
小弟要把它改为Winform下的程序,请问照片应该怎样读???方法怎样写???
不太擅闯API啊。。。
...全文
相关推荐
OSI PI SDK开发包
OSI PI 实时数据库 SDK开发包,包含SDK程序,开发帮助,源代码等。
视频控制系统SDK开发包详解
本文还有配套的精品资源,点击获取 简介:SDK(软件开发工具包)是软件开发者用来高效开发特定功能应用程序的一系列程序接口集合。本压缩包“sdk.rar”专注于SDK在视频控制系统中的应用,涵盖了API接口、库文件、示例代码、文档、调试工具、更新与支持等核心组件。视频控制系统是一个涉及图像处理、流媒体传输、编码解码等复杂技术体系的领域,SDK通过提供上述组件简化了开发流程,加...
德卡T10 sdk开发包
该开发包包含德卡T10读卡器C#,java,ocx,python,qt,vs的读卡sdk,通过修改德卡自带的ocx demo已经写好了IE浏览器 火狐浏览器读取身份证信息的html,IE8 火狐47测试有效,火狐52开始已经停止对npapi的支持了。开发过程等可以查看我的博客文章。
宇视视频SDK开发包
宇视视频SDK开发包,方便集成开发。里面包含 VC++
神思SDK开发包.zip
包含神思开发软件的全套SDK和DEMO,包含网页,C#,java,安卓等。每种都有DEMO,很详细,亲测可用。(需配合神思的机器使用)


