//using System; //using System.Collections.Generic; //using System.Linq; //using System.Web; //using System.Runtime.InteropServices; //using System.Threading; //using System.Text; //namespace EmisTerminal.EIF //{ // public class IDCertNew // { // #region 民族表 // static public string[] Nation = {"无", // "汉族","蒙古族","回族","藏族","维吾尔族", // "苗族","彝族","壮族","布依族","朝鲜族", // "满族", // "侗族", // "瑶族", // "白族", // "土家族", // "哈尼族", // "哈萨克族", // "傣族", // "黎族", // "傈僳族", // "佤族", // "畲族", // "高山族", // "拉祜族", // "水族", // "东乡族", // "纳西族", // "景颇族", // "柯尔克孜族", // "土族", // "达斡尔族", // "仫佬族", // "羌族", // "布朗族", // "撒拉族", // "毛难族", // "仡佬族", // "锡伯族", // "阿昌族", // "普米族", // "塔吉克族", // "怒族", // "乌孜别克", // "俄罗斯族", // "鄂温克族", // "崩龙族", // "保安族", // "裕固族", // "京族", // "塔塔尔族", // "独龙族", // "鄂伦春族", // "赫哲族", // "门巴族", // "珞巴族", // "其它", // "外国血统"}; // #endregion // #region 导入函数 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int InitComm(int port); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int InitCommExt(); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int CloseComm(); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int Authenticate(); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int Read_Content(int active); // [DllImport("termb.dll", CharSet = CharSet.Ansi)] // public static extern int Read_Content_Path(string path, int active); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe int GetSAMID(ref byte id); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern int GetRFID(ref UInt32 id); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern void LedOnOff(Int32 ledid, bool onoff); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern void BuzzerOnOff(int onoff); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetName2(ref byte sName, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetSex2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetNation2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetBornDate2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetAddress2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetIDNo2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetSignGov2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetStartDate2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetEndDate2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetNewAddress2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe int TransApduCommand(int nReaderSlot, ref byte pSendDatas, int nSendLen, ref byte pRecvDatas, ref int nRecvLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe int ResetCard(int nReaderSlot, ref byte pRecvDatas, ref int nRecvLen); // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFingerPrint2(ref byte sBuf, ref int nLen); // [DllImport("termb.dll", CharSet = CharSet.Ansi)] // public static extern unsafe bool MakeIDCardImages(string sHead, string sIDCardImagePath); // //外国人永久居住证 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe int IsFPRIDCard();//是否是外国人居住证 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_ENName2(ref byte sBuf, ref int nLen);//英文名 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_SEX2(ref byte sBuf, ref int nLen);//性别 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_IDNo2(ref byte sBuf, ref int nLen);//身份证号 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_NationCode2(ref byte sBuf, ref int nLen);//国籍代码 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_Nation2(ref byte sBuf, ref int nLen);//国籍代码中文() // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_CHNName2(ref byte sBuf, ref int nLen);//中文姓名 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_ValidStartDate2(ref byte sBuf, ref int nLen);//证件签发时间 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_ValidEndDate2(ref byte sBuf, ref int nLen);//证件终止时间 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_Birthday2(ref byte sBuf, ref int nLen);//出生日期 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_IDVersion2(ref byte sBuf, ref int nLen);//证件版本号 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_IssuingAuthorityCode2(ref byte sBuf, ref int nLen);//当次申请受理机关代码 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetFPR_IDType2(ref byte sBuf, ref int nLen);//证件类型标识 // //--------------------------------------------------------------------------- // //港澳台居民居住证相关函数 // //--------------------------------------------------------------------------- // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe int IsGATIDCard();//是否港澳台居民居住证 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_Name2(ref byte sBuf, ref int nLen);//姓名 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_SEX2(ref byte sBuf, ref int nLen);//性别 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_SEXCode2(ref byte sBuf, ref int nLen);//性别代码 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_Address2(ref byte sBuf, ref int nLen);//详细地址 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_IDNo2(ref byte sBuf, ref int nLen);//公民身份证号码 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_IssuingAuthority2(ref byte sBuf, ref int nLen);//签发机关 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_ValidStartDate2(ref byte sBuf, ref int nLen);//有效起始日期 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_ValidEndDate2(ref byte sBuf, ref int nLen);//有效截至日期 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_PassportNo2(ref byte sBuf, ref int nLen);//通行证号码( // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_IssuanceCount2(ref byte sBuf, ref int nLen);//签发次数 // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool GetGAT_IDType2(ref byte sBuf, ref int nLen);//证件类型标识(2B),大写字母J // [DllImport("termb.dll", CharSet = CharSet.Auto)] // public static extern unsafe bool IsVerifyKey(); // #endregion // public static string GetSAMNo() // { // byte[] bySAMID = new byte[100]; // int nRet = IDCertNew.GetSAMID(ref bySAMID[0]); // if (nRet == 0) // return System.Text.Encoding.GetEncoding("GB2312").GetString(bySAMID); // return string.Empty; // } // #region 工具函数 // public static byte[] StrToByteArray(string str) // { // ASCIIEncoding encoding = new ASCIIEncoding(); // return encoding.GetBytes(str); // } // public static string ByteArrayToStr(byte[] barr) // { // System.Text.UnicodeEncoding encoding = new UnicodeEncoding(); // return encoding.GetString(barr); // } // #endregion // } //}