|
-
Sep 4th, 2008, 03:10 AM
#1
Thread Starter
New Member
which API can list out all my dialup connection
hi all,
i looking for many days on this topic already. as i know maybe is using RASAPI32 to do this. but i have vb6 code only. when i convert to vb.net. there have problem like "As Any" not supported by .net, declaration "TYPE" also not supported and etc. who can teach me how to modified?
code:
Private Type RAS_ENTRIES
dwSize As Long
szEntryname(256) As Byte
End Type
Private Declare Function RasEnumEntriesA Lib "rasapi32.dll" (ByVal reserved As String, ByVal lpszPhonebook As String, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long
sub
Dim plSize As Long
Dim plEntries As Long
Dim psConName As String
Dim plIndex As Long
Dim RAS(255) As RAS_ENTRIES
Erase sDunList()
RAS(0).dwSize = 264
plSize = 256 * RAS(0).dwSize
Call RasEnumEntriesA(vbNullString, vbNullString, RAS(0), plSize, plEntries)
plEntries = plEntries - 1
If plEntries >= 0 Then
ReDim sDunList(plEntries)
For plIndex = 0 To plEntries
psConName = StrConv(RAS(plIndex).szEntryname(), vbUnicode)
sDunList(plIndex) = Left$(psConName, InStr(psConName, vbNullChar) - 1)
Next plIndex
End If
end sub
thanks~
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
|