嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 3 元微信扫码支付:3 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
寻卡,对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());
}
}