Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Connessione a internet

  1. #1

    Connessione a internet

    Vorrei fare un collegamento a internet da Visual Basic senza passare attraverso alla finestra di connessione di windows.
    Qualcuno sa quali comandi devo inviare al modem per l'handshake?
    Ciao
    Grazie

  2. #2
    ho trovato questa API

    codice:
    '**************************************
    'Windows API/Global Declarations for :Au
    '     tomatic Internet Dialup
    '**************************************
    Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
    Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
    
    
    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
    
    '**************************************
    ' Name: Automatic Internet Dialup
    ' Description:Most code snippets simply 
    '     show you how to display
    a connect dialog. The problem with this is that 
    it doesn't force a dial-up and won't alert you 
    when a connection is established.
    This code solves those problems by using Internet 
    Explorer's own 'automatic dial-up' settings 
    (Control Panel >> Internet options >> Connections).
    It utilises two little-known API calls that can 
    automatically connect / disconnect from the 
    default connection.
    Note: If the 'Never Dial a Connection' option is 
    
    
    selected, this code will not be able to connect. 
        I came across this API awhile ago when my friend 
        suggested a forced dialup and gave me this tip. 
        It's actually pretty helpful.
    ' By: Bradley Liang
    '
    '
    ' Inputs:None
    '
    ' Returns:None
    '
    'Assumes:None
    '
    'Side Effects:None
    'This code is copyrighted and has limite
    '     d warranties.
    'Please see http://www.Planet-Source-Cod
    '     e.com/xq/ASP/txtCodeId.9359/lngWId.1/qx/
    '     vb/scripts/ShowCode.htm
    'for details.
    '**************************************
    
    ' !! Dial the Net Automatically !!
    ' This waits until the connection is mad
    '     e and THEN
    ' proceeds. --Bradley Liang
    
    
    Private Sub Command1_Click()
        'To prompt the user to connect to the Ne
        '     t
    
    
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0) Then
            	MsgBox "You're Connected!", vbInformation
        End If
        'To automatically start dialling
    
    
        If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
            	MsgBox "You're Connected!", vbInformation
        End If
        'To disconnect an automatically dialled 
        '     connection
    
    
        If InternetAutodialHangup(0) Then
            MsgBox "You're Disconnected!", vbInformation
        End If
    End Sub

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.