Esempio n. 1
0
 /// <summary>
 /// 结束资源
 /// </summary>
 public void Dispose()
 {
     try
     {
         DLLHelper.CH9326CloseDevice(hand);
     }
     catch (Exception ex)
     {
         Logger.WriteLog("结束身份证读卡器句柄错误:" + ex.Message);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// USBHID协议驱动打开
        /// </summary>
        /// <returns></returns>
        public int USBHIDOpen()
        {
            string vid = "1A86"; string pid = "E010";

            try
            {
                ushort VID = Convert.ToUInt16(vid, 16); ushort PID = Convert.ToUInt16(pid, 16);
                hand = DLLHelper.CH9326OpenDevices(VID, PID);
                if (hand.unused > 0)
                {
                    DLLHelper.CH9326CloseDevice(hand);
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog(ex.Message);
                return(0);
            }
        }