Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send file to com1 port?

Tags:

I need to send file (text file) to com1 (RS-232) port, how i can do it ?

thank's in advance

like image 855
Gold Avatar asked Aug 12 '09 17:08

Gold


1 Answers

First answer:

type file.txt > com1

Edit after spotting the C# tag 8-) I think this will work:

using System.IO;
...
File.Copy(@"c:\file.txt", "com1");

but I can't properly test it as I have nothing I can plug into my COM1 port. 8-) It appears to work, in that it blocks rather than throwing an exception.

like image 182
RichieHindle Avatar answered Oct 02 '22 13:10

RichieHindle