Results 1 to 2 of 2

Thread: Dial-up

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Caracas, Venezuela
    Posts
    11
    I want to work in peace, and only dial-up when ready for it. To that I use:

    x = Shell("rundll32.exe rnaui.dll,RnaDial " & (connection), 1)

    But is there any way to know wich connections I have and wich is deafault?

    regards,
    Kristen
    Drastrup

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Code:
    'PUT THIS CODE IN A FORM WITH 1 COMMAND BUTTON
    Private Declare Function InternetAutodial Lib "wininet.dll" _
    (ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
    
    
    Private Declare Function InternetAutodialHangup Lib "wininet.dll" _
    (ByVal dwReserved As Long) As Long
    
    Private Declare Function InternetGetConnectedState _
    Lib "wininet.dll" (ByRef lpSFlags As Long, _
    ByVal dwReserved As Long) As Long
    
    Public Enum InetConnect
        AUTO = 1
        PROMPT = 2
        DCONNECT = 3
    End Enum
    
    Public Enum ConType
        LAN = 1
        MODEM = 2
        NONE = 3
        ALREADY = 4
    End Enum
    
    Private Function Online() As Boolean
        'If you are online it will return True, otherwise False
        Online = InternetGetConnectedState(0&, 0&)
    End Function
    Private Function ViaLAN() As Boolean
    
    Dim SFlags As Long
    'return the flags associated with the connection
    Call InternetGetConnectedState(SFlags, 0&)
    
    'True if the Sflags has a LAN connection
    ViaLAN = SFlags And INTERNET_CONNECTION_LAN
    
    End Function
    Private Function ViaModem() As Boolean
    
    Dim SFlags As Long
    'return the flags associated with the connection
    Call InternetGetConnectedState(SFlags, 0&)
    
    'True if the Sflags has a modem connection
    ViaModem = SFlags And INTERNET_CONNECTION_MODEM
    
    End Function
    Public Sub ConnectInet(CType As InetConnect)
    
    Select Case CType
    
    Case PROMPT
        'To prompt the user to connect to the Net
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0) Then
        'You are Connected
        End If
    Case AUTO
        'To automatically start dialling
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
        'You are connected
        End If
    Case DCONNECT
        'To disconnect an automatically dialled connection
        If InternetAutodialHangup(0) Then
        'You are disconnected
        End If
    End Select
    End Sub
    
    Private Sub Command1_Click()
    If Not Online Then
        ConnectInet (AUTO)
    End If
    ConnectInet (PROMPT)
    End Sub
    Replace the wink smilies with )
    hth

    [Edited by crispin on 11-15-2000 at 09:30 AM]
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

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