I have written a small program that listens on a serial port (COM2). Upon DataReceived (event), I write the info to a DB for reporting. The program works well when installed locally. Is it possible to point the SerialPort class to a remote machine so I can run it from my desktop?
* File: PhoneMonitor.cs
* Author: Matt Skelton
* Date: October 29, 2008 : Created
* October 30, 2008 : Updated
* Description: The PhoneMonitor program listen to the COMx port (serial)
* of a machine. On DataReceived (event), the info is written to DB.
* COMx can be changed to the desired serial port.
public partial class PhoneMonitor : Form
private SerialPort port = new SerialPort();
port.PortName = "COM2";
port.BaudRate = 19200;
port.Parity = Parity.None;
port.DataBits = 8;
port.StopBits = StopBits.One;
port.DtrEnable = true;
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
catch (Exception e)
#region Event Handlers
/// <param name="sender"></param>
/// <param name="e"></param>
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
textboxOutput.Text += port.ReadLine();