PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Firewall
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
InternetConnected (Function)
In French: InternetConnecté
Defines whether an Internet connection is enabled on the current computer.
Versions 19 and later
AndroidAndroid Widget iPhone/iPad Allows you to be notified when the status of the Internet connection changes.
New in version 19
AndroidAndroid Widget iPhone/iPad Allows you to be notified when the status of the Internet connection changes.
AndroidAndroid Widget iPhone/iPad Allows you to be notified when the status of the Internet connection changes.
Versions 17 and later
Android This function is now available for the Android applications.
New in version 17
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Versions 19 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 19
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 20 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 20
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Active Internet connection?
ResConnection = InternetConnected()
IF ResConnection = True THEN
        Info("An Internet connection is enabled")
ELSE
        Info("No Internet connection is enabled")
END
Syntax

Finding out whether an Internet connection is enabled Hide the details

<Result> = InternetConnected()
<Result>: Boolean
  • True if an Internet connection is enabled on the current computer,
  • False otherwise.
Versions 19 and later
AndroidAndroid Widget iPhone/iPad

Asking for a notification when the status of the Internet connection changes Hide the details

<Result> = InternetConnected([<Procedure Name>])
<Result>: Boolean
  • True if the procedure was associated with InternetConnected,
  • False otherwise.
<Procedure Name>: Character string (with or without quotes)
WLangage procedure ("callback" procedure) called when the status of Internet connection changes.
This procedure has the following format:
PROCEDURE <Procedure Name>(<Status>)
<Status> is an integer constant corresponding to the new status of the Internet connection.
It can take the following values:
networkDisconnectedThe network is disconnected or inaccessible.
networkEthernetThe Internet connection is performed by Ethernet.
networkMobileThe Internet connection is performed in mobile mode: edge, 2G, 3G, 4G, ...
networkWifiThe Internet connection is performed by Wi-Fi.

If <Procedure Name> corresponds to an empty string (""), the WLanguage procedure that was defined beforehand will not be called anymore.
New in version 19
AndroidAndroid Widget iPhone/iPad

Asking for a notification when the status of the Internet connection changes Hide the details

<Result> = InternetConnected([<Procedure Name>])
<Result>: Boolean
  • True if the procedure was associated with InternetConnected,
  • False otherwise.
<Procedure Name>: Character string (with or without quotes)
WLangage procedure ("callback" procedure) called when the status of Internet connection changes.
This procedure has the following format:
PROCEDURE <Procedure Name>(<Status>)
<Status> is an integer constant corresponding to the new status of the Internet connection.
It can take the following values:
networkDisconnectedThe network is disconnected or inaccessible.
networkEthernetThe Internet connection is performed by Ethernet.
networkMobileThe Internet connection is performed in mobile mode: edge, 2G, 3G, 4G, ...
networkWifiThe Internet connection is performed by Wi-Fi.

If <Procedure Name> corresponds to an empty string (""), the WLanguage procedure that was defined beforehand will not be called anymore.
AndroidAndroid Widget iPhone/iPad

Asking for a notification when the status of the Internet connection changes Hide the details

<Result> = InternetConnected([<Procedure Name>])
<Result>: Boolean
  • True if the procedure was associated with InternetConnected,
  • False otherwise.
<Procedure Name>: Character string (with or without quotes)
WLangage procedure ("callback" procedure) called when the status of Internet connection changes.
This procedure has the following format:
PROCEDURE <Procedure Name>(<Status>)
<Status> is an integer constant corresponding to the new status of the Internet connection.
It can take the following values:
networkDisconnectedThe network is disconnected or inaccessible.
networkEthernetThe Internet connection is performed by Ethernet.
networkMobileThe Internet connection is performed in mobile mode: edge, 2G, 3G, 4G, ...
networkWifiThe Internet connection is performed by Wi-Fi.

If <Procedure Name> corresponds to an empty string (""), the WLanguage procedure that was defined beforehand will not be called anymore.
Remarks
WINDEVReports and QueriesUser code (UMC)

Firewall

InternetConnected uses a ping request in order to check the access to Internet. Therefore, the ping must be allowed by the security parameters of the network in order for the result of the function to be pertinent.
Note: The ping is performed on the Google DNS (6 seconds, 1 attempt). The equivalent code is:
Ping("8.8.8.8", 6000, 1)
Versions 17 and later
AndroidAndroid Widget Required permissions
The call to this function modifies the permissions required by the application.
Required permission : ACCESS_NETWORK_STATE: this permission allows the applications to access information regarding the networks.
New in version 17
AndroidAndroid Widget Required permissions
The call to this function modifies the permissions required by the application.
Required permission : ACCESS_NETWORK_STATE: this permission allows the applications to access information regarding the networks.
AndroidAndroid Widget Required permissions
The call to this function modifies the permissions required by the application.
Required permission : ACCESS_NETWORK_STATE: this permission allows the applications to access information regarding the networks.
Versions 19 and later
AndroidAndroid Widget iPhone/iPad Change of connection status (syntax 2)
  • Call to the procedure:
    • iPhone/iPad The WLanguage procedure is called only when the network status changes. It is not called during the call to InternetConnected. You must call InternetConnected (without parameter) to find out whether the Internet connection is enabled or not.
    • AndroidAndroid Widget The WLanguage procedure is automatically called during the call to InternetConnected.
  • A single procedure can be associated with InternetConnected. If InternetConnected is called several times with different procedure names, the procedure used for detecting the status of the Internet connection will be replaced by the new specified procedure.
  • AndroidAndroid Widget If InternetConnected is called from a secondary thread, the procedure will be called in the main thread of the application.
New in version 19
AndroidAndroid Widget iPhone/iPad Change of connection status (syntax 2)
  • Call to the procedure:
    • iPhone/iPad The WLanguage procedure is called only when the network status changes. It is not called during the call to InternetConnected. You must call InternetConnected (without parameter) to find out whether the Internet connection is enabled or not.
    • AndroidAndroid Widget The WLanguage procedure is automatically called during the call to InternetConnected.
  • A single procedure can be associated with InternetConnected. If InternetConnected is called several times with different procedure names, the procedure used for detecting the status of the Internet connection will be replaced by the new specified procedure.
  • AndroidAndroid Widget If InternetConnected is called from a secondary thread, the procedure will be called in the main thread of the application.
AndroidAndroid Widget iPhone/iPad Change of connection status (syntax 2)
  • Call to the procedure:
    • iPhone/iPad The WLanguage procedure is called only when the network status changes. It is not called during the call to InternetConnected. You must call InternetConnected (without parameter) to find out whether the Internet connection is enabled or not.
    • AndroidAndroid Widget The WLanguage procedure is automatically called during the call to InternetConnected.
  • A single procedure can be associated with InternetConnected. If InternetConnected is called several times with different procedure names, the procedure used for detecting the status of the Internet connection will be replaced by the new specified procedure.
  • AndroidAndroid Widget If InternetConnected is called from a secondary thread, the procedure will be called in the main thread of the application.
Components
WINDEVReports and Queries wd230com.dll
Android wd230android.jar
See also
Minimum required version
  • Version 9
This page is also available for…
Comments
** Dica **
Cuidado, ao utilizar essa função, não é confiável para testar Internet. Usavamos em nosso ERP, porém aconteceu de parar nossa emissão de NFe devido a função retornar equivocadamente que não tinha Conexão de Internet na máquina.

Para testar Conexão de Internet recomendo utilizar, o Post do Adriano Boller:
http://forum.pcsoft.fr/fr-FR/pcsoft.us.windevmobile/605-conexao-internet/read.awp
Danilo
Dec. 22 2016