0
Answer

Reading Mifare smart cards

Neven Draskovic

Neven Draskovic

11y
1.7k
1

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?