Results 1 to 4 of 4

Thread: Dial Up Networking

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80

    Question

    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.

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  3. #3
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  4. #4
    Guest
    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
  •  



Click Here to Expand Forum to Full Width