title: C# waiting for the data on serial port
body: <p>i am trying to get data from fingerprint scanner through c# application, but before the fingerprint can send, a my whole code executes. </p>
  
  <p>I tried using delay function and <code>System.Threading.Thread.Sleep(1000)</code>, so it can get data before the next step executes, but it all seems futile.</p>
  
  <p>Could any one please provide any other option? </p>
  
  <p>I am using "<code>SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)</code>" to get data.</p>