423,832 Members | 1,902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,832 IT Pros & Developers. It's quick & easy.

How can i add Time stamp for serial port for sending data and receiving

P: 1
I am able to Transfer data and files over serial port in c# , but the problem is i have to send the file in 500 ms can anyone suggest me how to send the file within time period and how to add time stamp

here my code for sending files
Expand|Select|Wrap|Line Numbers
  1.    private void butSendFile_Click(object sender, EventArgs e)
  2.         {
  3.             if (serialPort1.IsOpen == false)
  4.             {
  5.                 this.serialPort1.Open();
  6.             }
  7.             serialPort1.Write(System.IO.File.ReadAllText(this.txtfile.Text));
  8.         }
  9.  
  10.         private void butSetFile_Click(object sender, EventArgs e)
  11.         {
  12.  
  13.             OpenFileDialog ofd = new OpenFileDialog();
  14.             if (ofd.ShowDialog() == DialogResult.OK)
  15.             {
  16.                 txtfile.Text = ofd.FileName;
  17.             }
  18.         }
Feb 15 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.