Card.LanBaoShiGY.ReadGasCard C# (CSharp) Метод

ReadGasCard() публичный Метод

public ReadGasCard ( short com, int baud, string &kh, int &ql, decimal &money, short &cs, short &bkcs, string &dqdm ) : int
com short
baud int
kh string
ql int
money decimal
cs short
bkcs short
dqdm string
Результат int
        public unsafe int ReadGasCard(short com, int baud, ref string kh, ref int ql, ref decimal money, ref short cs, ref short bkcs, ref string dqdm)
        {
            int rs = -1;
            try
            {
                PLtCardReader pcr1 = new PLtCardReader()
                {
                    dwDevType = 2,
                    dwPort = com,
                    dwBaud = baud,
                    dv_beep = 0
                };

                PUserCard puc1 = new PUserCard();

                int pti = 0;
                Log.Debug("LanBaoShi ReadGasCard start");
                rs = ReadUserCard(ref pcr1, ref puc1, pti);
                Log.Debug("LanBaoShi ReadGasCard end,return:" + rs);
                cs = (short)puc1.RechargeTimes;
                ql = (int)puc1.RechargeAmount / 10000;
                dqdm = new string((sbyte*)puc1.UserNO);
                string cardid = new string((sbyte*)puc1.CardNO);
                string str = cardid.Substring(0, 2);
                if (str != "??")
                {
                    kh = cardid;
                }
                else
                {
                    kh = cardid.Remove(0, 2);
                }
                if (rs == 0)
                {
                    Log.Debug("蓝宝石工业读卡成功!");
                    return 0;
                }
                else
                {
                    Log.Debug("蓝宝石工业读卡失败!");
                    return -1;
                }
            }
            catch (Exception e)
            {
                Log.Debug("蓝宝石工业读卡异常:" + e.Message + "--" + e.StackTrace);
            }
            return rs;
        }