|
-
Nov 3rd, 2000, 09:08 AM
#1
Thread Starter
Lively Member
Does anyone know how to get a list of available connections from dial up networking?
-
Nov 3rd, 2000, 02:58 PM
#2
I believe your going to have to use the SocketWrench tools to do this.
-
Nov 3rd, 2000, 06:11 PM
#3
'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
-
Nov 3rd, 2000, 11:33 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|