Neven Draskovic

Neven Draskovic

  • NA
  • 117
  • 140.2k

Reading Mifare smart cards

May 27 2013 7:11 AM

I have a really weird problem with reading Mifare 1k card from WinForm application. The reader I'm using is a PROMAG PCR-310U smart card reader. I have an application where a parent form creates a child form. That child form reads the smart card's ID and sends it to the parent.

I use this code to read the card:


MifareReader.CommPort = 4;
MifareReader.PortOpen = true;
MifareReader.mfRequest();
MessageBox.Show(MifareReader.mfAnticollision().ToString());
MifareReader.mfHalt();

The problem is this - the first time I create the child form, the reading process works perfectly but the second time (and every time after that) I create the child, the reader stops working - it returns "0" as the CardID whether the card is present or not. What could cause this error, and how would I fix it?