народ!
А как мне, допустим при нажатии на кнопку, проверить, есть ли у пользователя интернет?
Option Explicit
Private Const INTERNET_CONNECTION_CONFIGURED = &H40
Private Const INTERNET_CONNECTION_LAN = &H2
Private Const INTERNET_CONNECTION_MODEM = &H1
Private Const INTERNET_CONNECTION_OFFLINE = &H20
Private Const INTERNET_CONNECTION_PROXY = &H4
Private Const INTERNET_RAS_INSTALLED = &H10
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
Dim Ret As Long
InternetGetConnectedState Ret, 0&
If (Ret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then MsgBox "Local system has a valid connection to the Internet, but it may or may not be currently connected."
If (Ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then MsgBox "Local system uses a local area network to connect to the Internet."
If (Ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then MsgBox "Local system uses a modem to connect to the Internet."
If (Ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then MsgBox "Local system is in offline mode."
If (Ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then MsgBox "Local system uses a proxy server to connect to the Internet."
If (Ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then MsgBox "Local system has RAS installed."
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 158