AllApi.net

[an error occurred while processing this directive]
 
Const RAS_MAXENTRYNAME = 256
Const RAS_MAXDEVICETYPE = 16
Const RAS_MAXDEVICENAME = 128
Const RAS_RASCONNSIZE = 412
Private Type RasConn
    dwSize As Long
    hRasConn As Long
    szEntryName(RAS_MAXENTRYNAME) As Byte
    szDeviceType(RAS_MAXDEVICETYPE) As Byte
    szDeviceName(RAS_MAXDEVICENAME) As Byte
End Type
Private Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, lpcConnections As Long) As Long
Private Declare Function RasHangUp Lib "rasapi32.dll" Alias "RasHangUpA" (ByVal hRasConn As Long) As Long
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'This program will close your Internet-connection, so to test this, you will have to open an Internet-connection.
    Dim i As Long, lpRasConn(255) As RasConn, lpcb As Long
    Dim lpcConnections As Long, hRasConn As Long
    'Set the structure's size
    lpRasConn(0).dwSize = RAS_RASCONNSIZE
    lpcb = RAS_MAXENTRYNAME * lpRasConn(0).dwSize
    lpcConnections = 0
    'Enumerate all the available connections
    returncode = RasEnumConnections(lpRasConn(0), lpcb, lpcConnections)

    If returncode = 0 Then
        For i = 0 To lpcConnections - 1
            If Trim(CStr(lpRasConn(i).szEntryName)) = Trim(gstrispname) Then
                hRasConn = lpRasConn(i).hRasConn
                'Hang up
                returncode = RasHangUp(ByVal hRasConn)
            End If
        Next i
    End If
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/