vb.net te internet i kontrol etme

Son güncelleme: 21.06.2008 15:52
  • Namespace Internet

    Public Class cInternetConnection

    Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Integer, ByVal dwReserved As Integer) As Integer

    Public Const ProxyConnection As Integer = &H4S
    Public Const ModemConnectionIsBusy As Integer = &H8S
    Public Const InternetIsOffline As Integer = &H20S
    Public Const InternetConnectionIsConfigured As Integer = &H40S
    Public Const ModemConnection As Integer = &H1S
    Public Const RasInstalled As Integer = &H10S
    Public Const LanConnection As Integer = &H2S

    Public Function IsLanConnection() As Boolean
    Dim dwflags As Integer
    Call InternetGetConnectedState(dwflags, 0)
    IsLanConnection = dwflags And LanConnection
    End Function

    Public Function IsModemConnection() As Boolean
    Dim dwflags As Integer
    Call InternetGetConnectedState(dwflags, 0)
    IsModemConnection = dwflags And ModemConnection
    End Function

    Public Function IsProxyConnection() As Boolean
    Dim dwflags As Integer
    Call InternetGetConnectedState(dwflags, 0)
    IsProxyConnection = dwflags And ProxyConnection
    End Function

    Public Function IsConnected() As Boolean
    IsConnected = InternetGetConnectedState(0, 0)
    End Function

    Public Function IsRasInstalled() As Boolean
    Dim dwflags As Integer
    Call InternetGetConnectedState(dwflags, 0)
    IsRasInstalled = dwflags And RasInstalled
    End Function

    Public Function ConnectionTypeMsg() As String
    Dim dwflags As Integer
    Dim msg As String
    'Return Internet connection msg.

    If InternetGetConnectedState(dwflags, 0) Then

    If dwflags And InternetConnectionIsConfigured Then
    msg = msg & "Internet connection is configured." & vbCrLf
    End If

    If dwflags And LanConnection Then
    msg = msg & "Internet connection via a LAN"
    End If

    If dwflags And ProxyConnection Then
    msg = msg & ", and connection is through a proxy server."
    Else
    msg = msg & "."
    End If

    If dwflags And ModemConnection Then
    msg = msg & "Internet connection via a Modem"
    End If

    If dwflags And InternetIsOffline Then
    msg = msg & "Internet connection is currently offline."
    End If

    If dwflags And ModemConnectionIsBusy Then
    msg = msg & "Modem is busy with a non-Internet connection."
    End If

    If dwflags And RasInstalled Then
    msg = msg & "Remote Access Services are installed on local system."
    End If

    Else
    msg = "You are currently not connected to the internet."

    End If

    ConnectionTypeMsg = msg

    End Function
    End Class
    End Namespace
#27.10.2005 07:10 0 0 0
  • teşekkürler
#06.12.2005 18:14 0 0 0
  • teşekkürler de biraz açıklama yapsaydın daha hoş olurdu hatta alıntı olmuş ama yine de ellerine sağlık
#31.01.2007 08:02 0 0 0
  • serverdan çıkan interneti 10 kişi kullanıyor aramızda paylaştırdık interneti fakat server makine bende hangi kullanıcının ne kadar up ne kadar down yaptığını anlık değişmelerle görebileceğim bir program varmı elinizde? bu konuda yardımcı olabilirseniz sevinirim teşekkürler
#21.08.2007 19:29 0 0 0
  • Netmon diye birşey arattır bulursun ben bulursam burada sunarım ok bununla bütün ağdaki makinaların nekadar upload ne kadar download yaptığını görebilirsin
#27.08.2007 13:49 0 0 0
  • tsk
#07.12.2007 12:28 0 0 0
  • paylasım icin tesekkurler
#15.12.2007 13:39 0 0 0
  • Hocam eyvallah konu çok iyi de bi zahmet ne işe yaradığını nasıl kullanacağımızı yazarsan çok ii olur be hocam

    Saygılar...
#21.06.2008 15:52 0 0 0