PDA

View Full Version : سوال: گرفتن نام اتصال به اینترنت



شرلوک هلمز
جمعه 23 مرداد 1388, 12:27 عصر
اگه کسی میدونه در مورد این کد و چگونگی گرفتن نام اتصال بوسیله ان توضیح بده ممنون میشم
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As String) As Long

Babak.Hassanpour
جمعه 23 مرداد 1388, 13:28 عصر
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
Dim sConnType As String * 255
Private Sub Form_Load()
Dim Ret As Long
Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
If Ret = 1 Then
MsgBox "You are connected to Internet via a " & sConnType, vbInformation
Else
MsgBox "You are not connected to internet", vbInformation
End If
End Sub