PDA

Click to See Complete Forum and Search --> : How to get available connections and connecting to Internet


PandaNet
Aug 8th, 2000, 10:06 AM
I am making a phone tracker and need to get the information about all the available connections to internet in my computer. (I suppose thereīs a database or sthg, but I couldnīt find it).
I also need to know how to connect without making the connection screen appear. I need just to connect directly.
Thanks!!

kurtsimons
Aug 9th, 2000, 09:51 AM
---------------------
FORCE CONNECTION
------------------------



Const Internet_Autodial_Force_Unattended As Long = 2

Public Declare Function InternetAutodial Lib "wininet.dll" (ByVal dwFlags As
Long, ByVal dwReserved As Long) As Long
Public Declare Function InternetAutodialHangup Lib "wininet.dll" (ByVal
dwReserved As Long) As Long


'Code:
Dim lResult As Long
lResult = InternetAutodial(Internet_Autodial_Force_Unattended, 0&)
--------------------------------------------------------------------------------

Or this way:


code:--------------------------------------------------------------------------------
Private Sub CmdConnect_Click()
Dim X
'"MyConnectionsName" is the name under the icon in Dial-up Networking
X = Shell("rundll32.exe rnaui.dll,RnaDial " & "MyConnectionsName", 1)
DoEvents
'You can type in your password before the { below.
SendKeys "{enter}", True
DoEvents
End Sub---------------------

---------------------------------------------
TO GET AVAILABLE RAS ENTRIES!
---------------------------------------------



Public 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

Public Const RAS95_MaxEntryName = 256

Public Type RASENTRYNAME95
dwsize As Long
szentryname(RAS95_MaxEntryName) As Byte
End Type


--Form Code--

Dim s As Long, l As Long, ln As Long, a$
ReDim R(255) As RASENTRYNAME95

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)
Combo1.AddItem Left$(a$, InStr(a$, Chr$(0)) - 1)
Next