Hello,
You can try this code. I think it will solve your problem.
if (serialPort1.IsOpen == false)
{
this.serialPort1.Open();
}
using (StreamReader reader = new StreamReader(@"E:Text.txt"))
{
string line;
while ((line = reader.ReadLine()) != null)
{
serialPort1.Write(line + Environment.NewLine);
}
}
I think this code will serve your purpose.