基本信息
源码名称:C#开发RFID读写程序
源码大小:0.06M
文件格式:.rar
开发语言:C#
更新时间:2017-11-16
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 3 元 
   源码介绍

寻卡,对RFID卡进行写入

private void ReadOneBlock(int sectorIndex)
        {
            MWStatus mwStatus = new MWStatus();
            MWCommand mwCommand = new MWCommand();
            int ret;
            int index = 0;
            byte blockIndex;

            mwCommand.TxSeq = seq ;
            mwCommand.Command = 0x46;
            mwCommand.Len = 0x01;

            //块号
            blockIndex = (byte)(sectorIndex Convert.ToByte(cmbSector.Text) * 4);
            mwCommand.Parameters[index ] = blockIndex;

            ret = DoMWCommand(com, mwCommand, mwStatus);
            if (ret != 0)
                MessageBox.Show("读数据块" blockIndex.ToString()  "错误。");
            else
            {
                if (mwStatus.Status == 0)
                {
                    if (mwStatus.Len > 0)
                    {
                        byte[] cardSerial = new byte[mwStatus.Len];
                        for (int i = 0; i < mwStatus.Len; i ) cardSerial[i] = mwStatus.Parameters[mwStatus.Len - 1 - i];
                        MessageBox.Show("读数据块" blockIndex.ToString() "返回:" byteArrayToHex(cardSerial));
                    }
                    else
                        MessageBox.Show("读数据块" blockIndex.ToString() "成功。");
                }
                else MessageBox.Show("读数据块" blockIndex.ToString() "错误:" mwStatus.Status.ToString());
            }
        }