
Savoir si le pc est connecté à internet
Savoir si le pc est connecté à internet
Y a t'il une manip simple pour savoir si le pc est connecté à internet avec pure ?


- Progi1984
- Messages : 2659
- Inscription : mar. 14/déc./2004 13:56
- Localisation : France > Rennes
- Contact :
Test un ping sur www.google.fr !
Librairies & Applications : https://www.purebasic.fr/french/viewtop ... f=8&t=6220
Site Web : https://rootslabs.net
Site Web : https://rootslabs.net
Je viens de retrouver le lien, il y a un code que je copie ici:
http://jconserv.net/purebasic/viewtopic.php?t=10052
http://jconserv.net/purebasic/viewtopic.php?t=10052
Code : Tout sélectionner
; HowIsInternet - 09/22/2003 updated by TerryHough
; (c) ses007, 2003
; From PB forum, topic
; http://jconserv.net/purebasic/viewtopic.php?t=5590
#INTERNET_CONNECTION_MODEM = $1
#INTERNET_CONNECTION_LAN = $2
#INTERNET_CONNECTION_PROXY = $4
#INTERNET_CONNECTION_MODEM_BUSY = $8
#INTERNET_CONNECTION_OFFLINE = $20
#INTERNET_CONNECTION_CONFIGURED = $40
#INTERNET_RAS_INSTALLED = $10
Procedure.s InternetStatus()
Protected dwflags.l, msg.s
If InternetGetConnectedState_(@dwflags, 0)
If dwflags & #INTERNET_CONNECTION_CONFIGURED
msg = msg + "An Internet connection is configured." + Chr(10)
EndIf
If dwflags & #INTERNET_RAS_INSTALLED
msg = msg + "A Remote Access Service (RAS) is installed." + Chr(10)
EndIf
If dwflags & #INTERNET_CONNECTION_MODEM
msg = msg + "The Internet connection is made by a modem"
EndIf
If dwflags & #INTERNET_CONNECTION_LAN
msg = msg + "The Internet connection is made via a network (LAN)"
EndIf
If dwflags & #INTERNET_CONNECTION_PROXY
msg = msg + " and using a Proxy server." + Chr(10)
Else
msg = msg + "." + Chr(10)
EndIf
If dwflags & #INTERNET_CONNECTION_OFFLINE
msg = msg + "The Internet connection is currently offline. "
Else
msg = msg + "The Internet connection is currently connected (online)." + Chr(10)
EndIf
If dwflags & #INTERNET_CONNECTION_MODEM_BUSY
msg = msg + "The modem is busy with another connection."
EndIf
Else
msg = "Currently, there is no Internet connection."
EndIf
ProcedureReturn msg
EndProcedure
MessageRequester("Internet Connection", InternetStatus(), #MB_ICONINFORMATION)