namespace Project1
{
public partial class Form1 : Form
{
NFCReader NFC = new NFCReader();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
NFC.Connect(); // Connecting to the reader
ConnectedReaderField.Text = NFC.GetReadersList()[0].ToString(); // this sets the 'connected reader' input. NFC.GetReadersList is a LIST object containing connected ACS compatible readers
NFC.CardInserted += new NFCReader.CardEventHandler(CardInsertedAction);
NFC.Watch();
}
public void CardInsertedAction()
{
try
{
if (NFC.Connect())
{
CardStatusField.Text = "Present -> CARD UID: " + NFC.GetCardUID();
} else
{
CardStatusField.Text = "Failed to connect";
}
} catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
namespace Project1
{
public partial class Form1 : Form
{
NFCReader NFC = new NFCReader();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
NFC.Connect(); // Connecting to the reader
ConnectedReaderField.Text = NFC.GetReadersList()[0].ToString(); // this sets the 'connected reader' input. NFC.GetReadersList is a LIST object containing connected ACS compatible readers
NFC.CardInserted += new NFCReader.CardEventHandler(CardInsertedAction);
NFC.Watch();
}
public void CardInsertedAction()
{
try
{
if (NFC.Connect())
{
CardStatusField.Text = "Present -> CARD UID: " + NFC.GetCardUID();
} else
{
CardStatusField.Text = "Failed to connect";
}
} catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}