Isn't this possible in C#???

  • Thread starter Thread starter Ramakant Kasar
  • Start date Start date
R

Ramakant Kasar

Hi All,

I have come across an application that runs in background and records the
communication over the Serial Port. How it works is, the sample application
needs to be started and mapped to a serial port say COM1. Then the
applicaiton starts waiting for the data over the configured port and logs
the same on arrival.

When I tried to write the similar application in CSharp I have hit the road
blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.

Any ideas about what is the technique adopted by the sample application to
trap the serial port communication?

Thanks in advance,

Regards

Ramakant K.
 
I'm just guessing here, but WMI is used to monitor a lot of things. Maybe
they're using this for monitoring COM ports as well?
 
IMO you can't do that by opening the port again as this is an exclusive
resource.

It would be more something like using a driver allowing then to hook into
the port activity. Don't the sample application installs a driver ?

Patrice
 
When I tried to write the similar application in CSharp I have hit the road
blocks. Basically, when I try to open a port that is already opened it
throws an exception that the port in use cannot be opened again.

This is a lower level problem... this needs to be done at the driver
level (C/C++ only). Also, there is no language that will let you open a
serial port twice.

Jamie
 
Back
Top