Writing to a COM port with .Net


Question

How would I go about writing to a COM port, trying to convert the following example to .Net (C#), specifically the PHP part? If possible is there an easier way to write out to a USB?

1
2
11/2/2009 5:14:07 PM

Accepted Answer

Use the SerialPort class, e.g.:

SerialPort port = new SerialPort("COM1");
port.Open();
if (port.IsOpen)
{
}
port.Close();
9
10/30/2009 12:21:42 PM

see SerialPort class.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon