Questions! :-)

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Howdy ho all!

1st.) How can I find out if an internetconnection is available and online from within my app?

2nd.) How can I find out its IP? (Gateway?)

3rd.) If the connection is dropped, how can I find it out? :)


Thanks for the ppl who can help. :)


Mikey

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> How can I find out if an internetconnection is available and online from within my app?

Can't help with question 2, but questions 1 and 3 can be done like so:

Code: Select all

; Requires Win 98 or higher (or Win 95 with IE4 or higher).
If InternetGetConnectedState_(0,0)=0
  Debug "Offline"
Else
  Debug "Online"
EndIf

PB - Registered PureBasic Coder

Edited by - PB on 04 July 2002 15:42:23
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

and some nice flags:

#INTERNET_CONNECTION_MODEM = $1
#INTERNET_CONNECTION_LAN = $2
#INTERNET_CONNECTION_PROXY = $4
#INTERNET_CONNECTION_MODEM_BUSY = $8
#INTERNET_RAS_INSTALLED = $10
#INTERNET_CONNECTION_OFFLINE = $20
#INTERNET_CONNECTION_CONFIGURED = $40

lpdwFlags=0
dwReserved=0
InternetGetConnectedState_(@lpdwFlags.l,dwReserved.l)

MessageRequester("Info",Str(lpdwFlags),0)


Edited by - Rings on 04 July 2002 16:47:22
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Wow! Thanks for that tip, now I only have to find out what IP the Internet connection is. :)


Thanks a lot!

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> now I only have to find out what IP the Internet connection is. :)

But you already posted a tip of how to do this, here: http://tinyurl.com/kdo


PB - Registered PureBasic Coder

Edited by - PB on 04 July 2002 21:35:12
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Yep, thats right but with this short code you get all IPs of your system. But its very importend for me only to have the INet Gateway.

Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> its very importend for me only to have the INet Gateway.

I see. I don't know, sorry.

PB - Registered PureBasic Coder
Post Reply