unsafe class Program
{
[DllImport("mwhrf_bj.dll")]
public static extern int rf_card(int icdev, Byte _Mode, UInt64* _Snr); [DllImport("mwhrf_bj.dll")]
public static extern int Open_USB(); [DllImport("mwhrf_bj.dll")]
public static extern int Close_USB(int icdev); [DllImport("mwhrf_bj.dll")]
public static extern int rf_beep(int icdev, UInt32 _Msec); static void Main(string[] args)
{
int devID = Open_USB();
Console.WriteLine("打开端口成功");
while (true)
{
UInt64 cardSN;
int flag= rf_card(devID, (Byte)0x00, &cardSN);//寻一次卡 然后卡片必须拿开
//int flag= rf_card(devID, (Byte)0x00, &cardSN);//在卡片不拿走的情况连续询卡
if (flag != )
{
rf_beep(devID, );
Console.WriteLine("寻卡成功,卡号是{0}", cardSN);
}
Thread.Sleep();
}
Close_USB(devID);
Console.WriteLine("关闭端口成功");
}
}