酒店智能门锁SDK接口通用转换函数对接酒店收银-SAAS本地化-未来之窗行业应用跨平台架构

 一、通用转换代码

    public class CyberWin_LocakAPP
    {
        // public static byte[] bufCard = new byte[128 + 1];
        public static string 未来之窗_美萍_getsign(byte[] bufCard)
        {
            int i;
            string 酒店标识, s, s2;
            
            // 先读卡
            string 未来之窗 = Encoding.ASCII.GetString(bufCard);
            //  edt_CardData.Text = 未来之窗;// bufCard as string;
            //@ Unsupported function or procedure: 'copy'
            if (Copy(bufCard, 25, 8) == "FFFFFFFF")
            {

                System.Windows.Forms.MessageBox.Show("此卡是空白卡,请换一张能开门的卡", "提示", System.Windows.Forms.MessageBoxButtons.OK);
                return "此卡是空白卡,请换一张能开门的卡";
            }
            //@ Unsupported function or procedure: 'copy'
            s = Copy(bufCard, 11, 4);
            i = Convert.ToInt32(s, 16) % 16384;
            //@ Unsupported function or procedure: 'copy'
            s2 = Copy(bufCard, 9, 2);
            i = i + (Convert.ToInt32(s, 16) * 65536);
            // i = Convert.ToInt32(coid.Substring(0, 2), 16) * 65536 + Convert.ToInt32(coid.Substring(2, 4), 16) % 16383;

            int i2 = Convert.ToInt32(Copy(bufCard, 9, 2), 16) * 65536 + Convert.ToInt32(Copy(bufCard, 11, 4), 16) % 16383;
            酒店标识 = (i2).ToString();


            return 酒店标识;

        }

        public static string Copy(byte[] 字符串, int 开始, int 长度)
        {
            string 完整 = "";
            for (int i = 0; i < 字符串.Length; i++)
            {
                完整 = 完整 + ((char)字符串[i]).ToString();
            }
            // textBox1.Text = 完整;
            if (开始 < 1)
            {
                开始 = 1;
            }

            string 返回 = 完整.Substring(开始 - 1, 长度);

            return 返回;



        }



    }

二、阿雪技术观


拥抱开源与共享,见证科技进步奇迹,畅享人类幸福时光!

让我们积极投身于技术共享的浪潮中,不仅仅是作为受益者,更要成为贡献者。无论是分享自己的代码、撰写技术博客,还是参与开源项目的维护和改进,每一个小小的举动都可能成为推动技术进步的巨大力量

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值