|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Isn't this possible in C#???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? Show quoteHide quote "Ramakant Kasar" <ramakant_kasar_NOSPAM@systime.co.in> wrote in message news:OFVB7j7yEHA.2196@TK2MSFTNGP14.phx.gbl... > 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. > > 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 -- Show quoteHide quote"Ramakant Kasar" <ramakant_kasar_NOSPAM@systime.co.in> a écrit dans le message de news:OFVB7j7yEHA.2196@TK2MSFTNGP14.phx.gbl... > 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. > > > When I tried to write the similar application in CSharp I have hit the road This is a lower level problem... this needs to be done at the driver > 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. > level (C/C++ only). Also, there is no language that will let you open a serial port twice. Jamie |
|||||||||||||||||||||||