Results 1 to 4 of 4

Thread: Listing Dial Up Networking Connections

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111
    Does anyone know how to get a list of available connections from dial up networking?

  2. #2
    Guest
    I believe your going to have to use the SocketWrench tools to do this.

  3. #3
    Guest
    'put this into a form with a listbox

    Code:
    Private Const RAS_MAXENTRYNAME As Integer = 256
    Private Const RAS_MAXDEVICETYPE As Integer = 16
    Private Const RAS_MAXDEVICENAME As Integer = 128
    
    Private Type RASENTRYNAME95
       dwSize As Long
       szEntryName(RAS_MAXENTRYNAME) As Byte
    End Type
    
    Private Type RASCONN95
       dwSize As Long
       hRasConn As Long
       szEntryName(RAS_MAXENTRYNAME) As Byte
       szDeviceType(RAS_MAXDEVICETYPE) As Byte
       szDeviceName(RAS_MAXDEVICENAME) As Byte
    End Type
    
    Private Declare Function RasEnumConnections Lib _
       "rasapi.32.dll" Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, lpConnections 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
    
    
    Private Sub Form_Load()
       Dim Lar1 As Long
       Dim s As Long
       Dim L As Long
       Dim ln As Long
       Dim a As String
       Dim r(255) As RASENTRYNAME95
       
       Lar1 = 0
       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
    
    End Sub

  4. #4
    Guest
    That's a good code larryn. Thanks for it.
    And to think, you don't need any tools, just API.

    *feels embarassed*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width