|
-
Jul 19th, 2000, 10:24 AM
#1
Thread Starter
Lively Member
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.
-
Jul 19th, 2000, 10:27 AM
#2
Fanatic Member
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?
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 19th, 2000, 10:35 AM
#3
Fanatic Member
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"
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 19th, 2000, 12:07 PM
#4
You could try:
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&)
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
Hope that helps.
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
|