23.12.2012 Views

Digital Forensics in Small Devices: RFID Tag Investigation

Digital Forensics in Small Devices: RFID Tag Investigation

Digital Forensics in Small Devices: RFID Tag Investigation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

}<br />

}<br />

this.cmbReaders.Items.Insert(0, desc);<br />

for (u<strong>in</strong>t dev = 0; dev < num<strong>Devices</strong>; dev++)<br />

{<br />

}<br />

desc = usb<strong>RFID</strong>.GetDeviceStr<strong>in</strong>g(dev);<br />

this.cmbReaders.Items.Insert((<strong>in</strong>t)dev, desc);<br />

this.cmbReaders.EndUpdate();<br />

this.cmbReaders.SelectedIndex = 0;<br />

catch (Exception ex)<br />

{<br />

}<br />

MessageBox.Show(ex.Message);<br />

// Def<strong>in</strong>e the Delegate and Method for detect<strong>in</strong>g unplugged USB<br />

// from our callback (made <strong>in</strong> a different thread).<br />

private delegate void ConnectionLostDelegate(System.IntPtr cyDevice);<br />

// Our method for updat<strong>in</strong>g the Example1 class<br />

private void ConnectionLostMethod(System.IntPtr cyDevice)<br />

{<br />

if (cyDevice == hReader)<br />

{<br />

hReader = IntPtr.Zero;<br />

MessageBox.Show(this, "Connection to Reader has been lost or Reader<br />

has been turned off!", "Notification", MessageBoxButtons.OK,<br />

MessageBoxIcon.Exclamation);<br />

usb<strong>RFID</strong>.OnConnectionLost -= OnConnectionLost;<br />

usb<strong>RFID</strong>.OnAsyncRead -= OnAsyncRead;<br />

btnConnect.Enabled = true;<br />

btnDisConnect.Enabled = false;<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!