Page 1 of 1

Check your Internetconnection

Posted: Tue Mar 25, 2003 12:13 am
by BackupUser
Code updated For 5.20+

Restored from previous forum. Originally posted by ses.

Are you online? :)

Code: Select all

; 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 furnished." + 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)


Posted: Tue Mar 25, 2003 5:38 am
by BackupUser
Restored from previous forum. Originally posted by ricardo.


Hi,

I test it and receive this four strings in the msgbox:


"An Internet connection is furnished.""The Internet connection is made by a modem""There is at present no Internet connection. ""A Remote Access Service (RAS) is installed."

Im connected by a modem and have another 2 cards, one for the home net and another one i used for internet by an antenna. For internet im usign at this moment just the modem.



Best Regards

Ricardo

Dont cry for me Argentina...