public byte SelLang(string lang)
        {
            byte res = 0xFF;//ERROR

            if (Session["EmvKernel"] != null)
            {
                EmvKerSess          = (EmvKernelSession)Session["EmvKernel"];
                EmvKerSess.Language = lang;

                EmvKerSess.mre = new ManualResetEvent(false);
                EmvKerSess.mreWait.Set();
                EmvKerSess.mre.WaitOne();
                res = (byte)EmvKerSess.FuncNum;
            }
            return(res);
        }
        public byte EmvRun()
        {
            if (Session["EmvKernel"] == null)
            {
                EmvKerSess           = new EmvKernelSession();
                Session["EmvKernel"] = EmvKerSess;
            }
            else
            {
                EmvKerSess = (EmvKernelSession)Session["EmvKernel"];
            }

            EmvKerSess.mreWait = new ManualResetEvent(false);
            EmvKerSess.mre     = new ManualResetEvent(false);
            EmvKerSess.Run();
            EmvKerSess.mre.WaitOne();
            //selLang
            return((byte)EmvKerSess.FuncNum);
        }