Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used GetPortNames property.It shows all the ports which are opened by other applications.I used Isopen property, It tells False always.Actually the port is opened by modem. it should give "true" right. But its not giving. Anybody Knows... explain
Posted

1 solution

http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.isopen(v=vs.110).aspx[^]

The IsOpen documentation states, "The IsOpen property tracks whether the port is open for use by the caller, not whether the port is open by any application on the machine."

I guess you'll need to find another way to tell.

I know with UDP ports, years ago, the only way I could tell if they were in use was to try and open one and if I got an exception it meant another app had it open. Perhaps serial ports have something similar.
 
Share this answer
 
Comments
Member 10500446 5-Mar-14 22:16pm    
Thank you... Got the solution
ZurdoDev 5-Mar-14 22:21pm    
Good to hear.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900