Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How will i continuous listen to COM for detecting modem.
if a modem is added or removed it should inform you that Modem installed or removed at COM45 etc.

I have tried to use a thread and check the com count but i am unable to know which com is modem.

If there is any specific class for this pls help me fr the code asap???
Posted
Updated 7-Dec-12 20:04pm
v2

1 solution

one of the way to achieve this is open the com port like

C#
SerialPort com = new SerialPort("com1");
com.Open();


your can loop from i to 250 com port if unsuccessful it will throw exception
and you can handle it.
other wise it will successfully open the port
 
Share this answer
 
Comments
shubhamjoshi 8-Dec-12 3:17am    
i dont want to loop i want to know only MODEM ports. Any solution using WMI and Win32_SerialPort??

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