It is currently Wed Aug 21, 2019 6:41 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Check connection ( online or offline )
PostPosted: Sat Mar 06, 2004 12:24 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Jan 27, 2004 2:17 pm
Posts: 119
how can i check connection for understand user are online or offline.

thanks.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 11, 2004 6:10 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat May 03, 2003 4:10 am
Posts: 169
Code:
; use it for which you want, ITS FREE 
; I used a bad translator on http://translate.google.com/translate_t
; because I am so tired
; (c) ses007, 2003


#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_CONNECTION_LAN
      msg = msg + "The Internet connection is made by a network"
    EndIf

    If dwflags & #INTERNET_CONNECTION_MODEM
      msg = msg + "The Internet connection is made by a modem"
    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 + "There is at present no Internet connection. "
    EndIf

    If dwflags & #INTERNET_CONNECTION_MODEM_BUSY
      msg = msg + "The modem uses at present another connection."
    EndIf

    If dwflags & #INTERNET_RAS_INSTALLED
      msg = msg + "A Remote Access Service (RAS) is installed."
    EndIf

  Else
    msg = "There is at present no Internet connection."

  EndIf

ProcedureReturn msg
EndProcedure

MessageRequester("Connection", InternetStatus(), 0)


here you go you might want to check the resorce site http://www.reelmediaproductions.com/pb
and the code archive here http://www.purearea.net/pb/CodeArchiv/English.html


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 12, 2004 5:13 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 5:24 pm
Posts: 7581
Note: Scurrier's quoted example requires Win 98 or higher (or Win 95 with
Internet Explorer 4 or higher installed) to run... which is probably not much
of a big deal these days. ;)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 12, 2004 10:07 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 7:44 pm
Posts: 465
Location: end of www
A shorter version, which just tells you if someone is off- or online.

Code:
; ------------------------------------------------------------
;
; PureBasic Win32 API - CheckInternetConnection - Example v1.0
;
; by MrVainSCL! aka Thorsten   19/Jan/2003    PB v3.51+
;
; ------------------------------------------------------------
;
    Procedure MyCheckInternetConnection()
        If InternetGetConnectedState_(0, 0)
          result = 1
        Else
          result = 0
        EndIf
        ;
        ProcedureReturn result
    EndProcedure

_________________
regards,
benny!
-
pe0ple ar3 str4nge!!!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye