Beispiel #1
0
 /// <summary>
 /// This is the function to write barcode data into file and it is called whenever there is an OnDataReceived event occurs.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dataReceived(object sender,OnDataReceivedEventArgs e)
 {
     try
     {
         barcodeData = new BarcodeData();
         barcodeData.DataBytes = e.data;
         WriteData(barcodeData.ToString() + "   " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss:fff"));
         textBox_status.AppendText(barcodeData.ToString());
     }
     catch (Exception ex)
     {
         textBox_status.AppendText(ex.ToString() + "\n");
     }
     finally
     {
         getWriter(filePath).Close();
     }
 }
Beispiel #2
0
 private void dataReceived(object sender,OnDataReceivedEventArgs e)
 {
     try
     {
         barcodeData = new BarcodeData();
         barcodeData.DataBytes = e.data;
         getWriter(filePath).WriteLine(barcodeData.ToString() + " " + new DateTime());
         getWriter(filePath).Flush();
         textBox_status.AppendText(barcodeData.ToString());
     }
     catch (Exception ex)
     {
         textBox_status.AppendText(ex.ToString() + "\n");
     }
     finally
     {
         getWriter(filePath).Close();
     }
 }
Beispiel #3
0
 /// <summary>
 /// This is the function to write barcode data into file and it is called whenever there is an OnDataReceived event occurs.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dataReceived(object sender,OnDataReceivedEventArgs e)
 {
     try
     {
         barcodeData = new BarcodeData();
         barcodeData.DataBytes = e.data;
         WriteData(barcodeData.ToString() + "   " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss:fff"));
         textBox_status.AppendText(barcodeData.ToString());
     }
     catch (Exception ex)
     {
         WriteLog(ex.ToString() + Environment.NewLine + "   at " + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss:fff"));
         textBox_status.AppendText("Exception Occured. Please refer log file." + "\n");
     }
     finally
     {
         CloseData();
     }
 }