DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[SIZE="2"]#If Win64 Then
Private Declare PtrSafe Function [COLOR="Red"]InternetCheckConnection[/COLOR] _
Lib "wininet.dll" Alias "InternetCheckConnectionA" _
(ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
#Else
Private Declare Function [COLOR="red"]InternetCheckConnection[/COLOR] _
Lib "wininet.dll" Alias "InternetCheckConnectionA" _
(ByVal lpszUrl As String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
#End If
Sub Emre()
Dim adres As String
adres = "web adresini buraya yazın"
If ([COLOR="red"]InternetCheckConnection[/COLOR](adres, &H1, 0&) = 0) Then
Local DB
Else
Mysql Db
End If
End Sub[/SIZE]
[SIZE="2"]Sub Emre()
Dim dizim(), ara, a As Integer, wmi As Object, oge As Object
Set wmi = GetObject("winmgmts:root\CIMV2").ExecQuery("SELECT * FROM Win32_NetworkAdapter", , 48)
For Each oge In wmi
If Not IsNull(oge.NetConnectionStatus) Then
ReDim Preserve dizim(a)
dizim(a) = oge.NetConnectionStatus
a = a + 1
End If
Next oge
If UBound(Filter(dizim, 2, True)) = 0 Then
MsgBox "Bağlantı Var", vbInformation, "BİLGİ!"
Else
MsgBox "Bağlantı Yok", vbInformation, "BİLGİ!"
End If
End Sub[/SIZE]
Bir başka alternatif;
Kod:[SIZE="2"]Sub Emre() Dim dizim(), ara, a As Integer, wmi As Object, oge As Object Set wmi = GetObject("winmgmts:root\CIMV2").ExecQuery("SELECT * FROM Win32_NetworkAdapter", , 48) For Each oge In wmi If Not IsNull(oge.NetConnectionStatus) Then ReDim Preserve dizim(a) dizim(a) = oge.NetConnectionStatus a = a + 1 End If Next oge If UBound(Filter(dizim, 2, True)) = 0 Then MsgBox "Bağlantı Var", vbInformation, "BİLGİ!" Else MsgBox "Bağlantı Yok", vbInformation, "BİLGİ!" End If End Sub[/SIZE]