Internet Bağlantısını Kontrol Etmek
(Modul)(General)(Declaration)
Public Declare Function RasEnumConnections Lib "RasApi32.dll" Alias _
"RasEnumConnectionsA" (lpRasCon As Any, lpcb As Long, _
lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib "RasApi32.dll" Alias _
"RasGetConnectStatusA" (ByVal hRasCon As Long, _
lpStatus As Any) As Long
Public Const RAS95_MaxEntryName = 256 ' Bağlantı Değişkenleri
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32
Public Type RASCONN95 ' Bağlantı Bilgileri
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Public Type RASCONNSTATUS95 ' Bağlantı Durumları
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
Private Sub Timer1_Timer()
If InternetDurumu = False Then
' İnternete bağlı olmadığını gösteren resim
Image1.Visible = True
' İnternete bağlı olduğunu gösteren resim
Image2.Visible = False
End If
If InternetDurumu = True Then
' İnternete bağlı olmadığını gösteren resim
Image1.Visible = False
' İnternete bağlı olduğunu gösteren resim
Image2.Visible = True
End If
End Sub