Exemplo n.º 1
0
        ///// <summary>
        ///// 禁止用户插卡
        ///// </summary>
        //public static void CancelWaitCard()
        //{

        //    int handle = 0;
        //    try
        //    {
        //        string port = SysConfigHelper.readerNode("CRT310Port");
        //        StringBuilder info = new StringBuilder(260);
        //        handle = CRT310.CommOpen("COM" + port);
        //        CRT310.TT_CancelWait(info);
        //    }
        //    catch (Exception e)
        //    {
        //        throw new WtException(WtExceptionCode.Sys.UNION_READ, e.Message);
        //    }
        //    finally
        //    {
        //        CRT310.CommClose(handle);
        //    }
        //}

        /// <summary>
        /// 禁止用户插卡
        /// </summary>
        public static void CancelWaitCard()
        {
            StringBuilder outMsg = new StringBuilder(260);

            try
            {
                StringBuilder port = new StringBuilder(SysConfigHelper.readerNode("CRT310Port"));
                StringBuilder bote = new StringBuilder("9600");
                StringBuilder info = new StringBuilder(260);

                int openPort = CRT310.TT_OpenDevice(port, bote, info);
                int ret      = CRT310.TT_CancelWait(info);
            }
            catch (Exception e)
            {
            }
            finally
            {
                CRT310.TT_CloseDevice(outMsg);
            }
        }