How to get a list of users DUN names? 
Author Message
 How to get a list of users DUN names?

How can I get the names of all the DUN icons a user has created in the
Windows Dial up Networking folder?

Thanks,
Ed Wilk



Wed, 07 May 2003 03:00:00 GMT  
 How to get a list of users DUN names?
'You need to use the RasEnumEntries from the file:
'c:\window\system\RasApi32.DLL
'This should so the job! Chris

Private Const RAS_MaxDeviceType = 16
Private Const RAS95_MaxDeviceName = 128
Private Const RAS95_MaxEntryName = 256
Private Type RASCONN95
    'set dwsize to 412
    dwSize As Long
    hRasConn As Long
    szEntryName(RAS95_MaxEntryName) As Byte
    szDeviceType(RAS_MaxDeviceType) As Byte
    szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Private Type RASENTRYNAME95
    'set dwsize to 264
    dwSize As Long
    szEntryName(RAS95_MaxEntryName) As Byte
End Type
Private Declare Function RasEnumConnections Lib "RasApi32.DLL" Alias
"RasEnumConnectionsA" (lprasconn As Any, lpcb As Long, lpcConnections As
Long) As Long
Private Declare Function RasEnumEntries Lib "RasApi32.DLL" Alias
"RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String,
lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long

Sub FillList1withEntries()
    ReDim r(255) As RASENTRYNAME95
    Dim s&,l&,ln&,a$
    r(0).dwSize = 264
    s = 256 * r(0).dwSize
    l = RasEnumEntries(vbNullString, vbNullString, r(0), s, ln)
    For l = 0 To ln - 1
        a$ = StrConv(r(l).szEntryName(), vbUnicode)
        list1.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
    Next
    If list1.ListCount <> 0 Then list1.ListIndex = 0
End If


Quote:
> How can I get the names of all the DUN icons a user has created in the
> Windows Dial up Networking folder?

> Thanks,
> Ed Wilk



Wed, 07 May 2003 03:00:00 GMT  
 How to get a list of users DUN names?
Thank you, I'll give it try.
Ed

On Sat, 18 Nov 2000 19:26:12 -0000, "Chris Farmer"

Quote:

>'You need to use the RasEnumEntries from the file:
>'c:\window\system\RasApi32.DLL
>'This should so the job! Chris

>Private Const RAS_MaxDeviceType = 16
>Private Const RAS95_MaxDeviceName = 128
>Private Const RAS95_MaxEntryName = 256
>Private Type RASCONN95
>    'set dwsize to 412
>    dwSize As Long
>    hRasConn As Long
>    szEntryName(RAS95_MaxEntryName) As Byte
>    szDeviceType(RAS_MaxDeviceType) As Byte
>    szDeviceName(RAS95_MaxDeviceName) As Byte
>End Type
>Private Type RASENTRYNAME95
>    'set dwsize to 264
>    dwSize As Long
>    szEntryName(RAS95_MaxEntryName) As Byte
>End Type
>Private Declare Function RasEnumConnections Lib "RasApi32.DLL" Alias
>"RasEnumConnectionsA" (lprasconn As Any, lpcb As Long, lpcConnections As
>Long) As Long
>Private Declare Function RasEnumEntries Lib "RasApi32.DLL" Alias
>"RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook As String,
>lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long

>Sub FillList1withEntries()
>    ReDim r(255) As RASENTRYNAME95
>    Dim s&,l&,ln&,a$
>    r(0).dwSize = 264
>    s = 256 * r(0).dwSize
>    l = RasEnumEntries(vbNullString, vbNullString, r(0), s, ln)
>    For l = 0 To ln - 1
>        a$ = StrConv(r(l).szEntryName(), vbUnicode)
>        list1.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
>    Next
>    If list1.ListCount <> 0 Then list1.ListIndex = 0
>End If



>> How can I get the names of all the DUN icons a user has created in the
>> Windows Dial up Networking folder?

>> Thanks,
>> Ed Wilk



Wed, 07 May 2003 03:00:00 GMT  
 How to get a list of users DUN names?
Chris,
It did the job very nicely!

Thanks again!
Ed



Wed, 07 May 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Getting a list of User Data Source names???

2. Getting List of DUN profiles from Registry...

3. getting users name and workstation name Urgent

4. Getting the user's logon name and computer name

5. Getting the User Group name using Current User Function

6. Getting full list of Domain Users is not working properly - some users missing

7. How to detect if user is DUN user?

8. Getting the list of Excel Sheet Names using VBA

9. getting a list of table names

10. Getting A List Of Machine Names On A LAN

11. help switching file names or getting list of files in a dir

12. Getting a control name form a list-box

 

 
Powered by phpBB® Forum Software