日期:2014-05-16 浏览次数:21017 次
if (rf_card(icDev, 0, ref _Snr) == 0)
{
//操作
}
private void btnSeekCard_Click(object sender, System.EventArgs e)
{
UInt16 tagtype=0;
byte size=0;
uint snr=0;
mifareone.rf_reset(icdev, 3);
st = mifareone.rf_request(icdev,1,out tagtype);
if(st!=0)
{
lbResult.Text="request error!";
return;
}
st = mifareone.rf_anticoll(icdev,0,out snr);
if(st!=0)
{
lbResult.Text="anticoll error!";
return;
}
string snrstr="";
snrstr=snr.ToString("X");
lbSnr.Text=snrstr;
st = mifareone.rf_select(icdev,snr,out size);
if(st!=0)
{
lbResult.Text="select error!";
return;
}
lbResult.Text="寻卡成功!";
}