ايران ويج

نسخه‌ی کامل: کانکت شدن به اینترنت در vb
شما در حال مشاهده‌ی نسخه‌ی متنی این صفحه می‌باشید. مشاهده‌ی نسخه‌ی کامل با قالب بندی مناسب.
صفحه‌ها: 1 2
چجوری میشه صدا شو خفه کرد؟
(۲۵-شهریور-۱۳۸۷, ۱۱:۲۰:۱۹)s4m4n نوشته است: [ -> ]چجوری میشه صدا شو خفه کرد؟

اينو فكر كنم از همون تنظيمات مودم بايد انجام بديد.
شما چه جوري تونستيد ؟ ميشه به منم بگيد؟
سلام من هم مشکل کانکت شدن را دارم ولی با Adsl اگه میشه توضیح بدین
که میشه با Adsl هم کانکت شد
سلام دوستان
چطوری کانکت بودن یا دیس بودن کاربر رو چک کنیم که اگه کانکت بود دیگه دستور رو اجرا نکنه ؟
(۲۲-اسفند-۱۳۸۹, ۱۳:۰۲:۱۹)GTAexcess نوشته است: [ -> ]سلام دوستان
چطوری کانکت بودن یا دیس بودن کاربر رو چک کنیم که اگه کانکت بود دیگه دستور رو اجرا نکنه ؟

سلام.
از این ای پی آی InternetGetConnectedState استفاده کن.
نقل قول: سلام.
از این ای پی آی InternetGetConnectedState استفاده کن.
داداشم میشه یه نمونه بذاری Biggrin ممنون
سلام.

کد:
Option Explicit
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
    'Internet connection VIA prxoy server.
    Public Const ProxyConnection As Long = &H4
    'Modem is busy.
    Public Const ModemConnectionIsBusy As Long = &H8
    'Internet connection is currently Offline
    Public Const InternetIsOffline As Long = &H20
    'Internet connection is currently configured
    Public Const InternetConnectionIsConfigured As Long = &H40
    'Internet connection VIA Modem.
    Public Const ModemConnection As Long = &H1
    'Remote Access Server is installed.
    Public Const RasInstalled As Long = &H10
    'Internet connection VIA LAN.
    Public Const LanConnection As Long = &H2

'Avali shabake vasl net ghat
'Dovomi shabake va net vasl
'Sevomi kolan ghat


Public Function IsLanConnection() As Boolean
    Dim dwflags As Long
    'return True if LAN connection
    Call InternetGetConnectedState(dwflags, 0&)
    IsLanConnection = dwflags And LanConnection
'T
'T
'F
End Function


Public Function IsModemConnection() As Boolean
    Dim dwflags As Long
    'return True if modem connection.
    Call InternetGetConnectedState(dwflags, 0&)
    IsModemConnection = dwflags And ModemConnection
'F
'F
'F
End Function


Public Function IsProxyConnection() As Boolean
    Dim dwflags As Long
    'return True if connected through a prxoy.
    Call InternetGetConnectedState(dwflags, 0&)
    IsProxyConnection = dwflags And ProxyConnection
'T
'T
'F
End Function

Public Function IsConnected() As Boolean
    'Returns true if there is any internet connection.
    IsConnected = InternetGetConnectedState(0&, 0&)
  'T
  'T
  'F
End Function

Public Function IsRasInstalled() As Boolean
    Dim dwflags As Long
    'return True if RAS installed.
    Call InternetGetConnectedState(dwflags, 0&)
    IsRasInstalled = dwflags And RasInstalled
'T
'T
'F
End Function


Public Function ConnectionTypeMsg() As String
    Dim dwflags As Long
    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 prxoy 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
صفحه‌ها: 1 2