Creating virtual serial port with C#

Liban picture Liban · Nov 29, 2012 · Viewed 24k times · Source

Possible Duplicate:
Faking an RS232 Serial Port

I have an application that reads data from serial port. To test the application i would like to create a virtual serial port that generates data and puts the the port at the same PC, so that the other app can access that data.

Any idea how?

Thanks

Answer

Honza Brestan picture Honza Brestan · Nov 29, 2012

I have used com0com tool for this. It has no direct API, but you can write an application (or a method) which starts a new com0com process to set up / modify your virtual ports "on the fly" with commandline parameters.