How to enumerate all devices.

Dec 1, 2010 at 4:04 AM
Edited Dec 1, 2010 at 4:05 AM

Hi. I am developing some app which I need to use RAS DIAL api."
I found documentation on msdn but its under C++. I'm in VB.net
Until I found this very helpful ras wrapper.

How to enumerate all names of devices capable of remote access?
and add this on combobox so user can select which DeviceName will use in creating new entry to phonebook.
I am using HUAWEI usb 3G modem.

 

Thanks.

Coordinator
Dec 1, 2010 at 7:37 AM
The RasDevice.GetDevices method returns an enumerable collection of RasDevice objects for all the devices RAS recognizes which are attached to the machine.
 
Imports System.Collections.ObjectModel
Imports DotRas

Dim devices As ReadOnlyCollection(Of RasDevice) = RasDevice.GetDevices()

Hope that helps. 

Dec 2, 2010 at 4:43 AM

I got it now.. Thanks sir.

Coordinator
Dec 2, 2010 at 4:43 AM

No problem. Happy coding!

May 6, 2011 at 7:40 AM

Hi Jeff,

Thanks for the above code snippet.  I also needed it to check the modems attached in my machine.

Now, I wanted to add a new modem in the "Control Panel" > "Phone and Modem Options" > "Modems" tab.

I tried to use the RasDevice.Create method, which requires me to have a Name and a Device Type, but apparently it's not created.  And I'm also wondering if there's a way to specify the COM port for the modem that I want to add?  I'd really be happy to know the correct method that I should use to add a new modem programmatically.

Thanks in advance.

Regards,

Ems