Getting a list of Broadband pppoe

Oct 22, 2010 at 2:05 AM

Hi all

I would like to know the way of getting a list of broadband pppoe.
(Using C#)

Actually What I would like to do is to get randam connection and disconnect to internet through maltiple pppoe connection list 
it's  already set in Windows XP. 

Calling  RasDevice.GetDevices() method

doesn't return the list of pppoe.

Is the any way ?


Also I know the way of rasdial command through dos prompt

Oct 22, 2010 at 9:10 PM

RasDevice.GetDevices is probably reporting actual PPPoE hardware connected to the machine, which it sounds like you're trying to retrieve broadband entries from within a phone book. In which case you'll want to use the RasPhoneBook and RasEntry classes (for more information on usage, see the DotRas SDK Help Documentation). Here's a very basic example:

using System.Collections.Generic;
using System.Linq;
using DotRas;

RasPhoneBook pbk = new RasPhoneBook();

IEnumerable<RasEntry> broadbandEntries = from entry in pbk.Entries
    where entry.EntryType == RasEntryType.Broadband
    select entry;

Keep in mind, your application will only support Windows XP or later since you're accessing broadband entries, which means you need to use the WINXP or later build type.

- Jeff

Oct 24, 2010 at 7:56 AM

Hi Jeff

Thanks for your reply.

I managed to solve the problem as the same way you tell me.

I tried first  "RasPhoneBook" but did not get anything.
I should have known the open method.

Anyway it's working fine for me.

Jeff , thank you for your reply again, hope this discussion help others.