Page 1 sur 1

Savoir si le pc est connecté à internet

Publié : ven. 04/févr./2005 21:19
par Patix
Y a t'il une manip simple pour savoir si le pc est connecté à internet avec pure ?
:roll:

Publié : lun. 07/févr./2005 9:48
par Progi1984
Test un ping sur www.google.fr !

Publié : lun. 07/févr./2005 13:59
par Patix
Pourquoi pas :-) !

Merci

s'il y a d'autres soluces je suis preneur 8) .

Publié : lun. 07/févr./2005 17:55
par comtois
je ne suis vraiment pas sûr , mais il me semble que cette question avait été posée sur le forum anglais , et regarde aussi dans codearchiv sur purearea.net

Publié : lun. 07/févr./2005 18:18
par nico
Je viens de retrouver le lien, il y a un code que je copie ici:
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) 

Publié : mar. 08/févr./2005 0:00
par Patix
Merci je vais tester maintenant :-)