Hi,
Does anyone know how to use vb to dial the user's default dial up networking connection?
Any suggestions would be greatly appreciated.
Best Regards,
Rob Brown.
Printable View
Hi,
Does anyone know how to use vb to dial the user's default dial up networking connection?
Any suggestions would be greatly appreciated.
Best Regards,
Rob Brown.
Tell the Internet transfer control to download a web page. This will automatically bring up the prompt
I have never tried it but maybe you could shell a shortcut to dial up networking?
NOT THE BEST WAY BUT IT WORKS LIKE THIS ON WinNT
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal opOperation As String, ByVal lpFile As String, ByVal opParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
' just call it like this ShellExe("Explorer")
Public Sub ShellExe(What As String)
On Error Resume Next
Call ShellExecute(0&, vbNullString, What, vbNullString, vbNullString, vbNormalFocus)
End Sub
ShellExe "C:\WINNT\System32\RAS\rasphone.pbk"
You could try:
Or this way:Code: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&)
Hope that helps.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