insanepyrokid Posted March 14, 2004 Share Posted March 14, 2004 can anyone tell me the easiest/shortest way to check if the computer is online? only ways i can come up with is assorted ip- and net- commands in CMD, but im sure theres a better way that takes up only a line or two. thanks. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 14, 2004 Developers Share Posted March 14, 2004 Maybe this threat is what you are looking for ? http://www.hiddensoft.com/forum/index.php?...findpost&p=8244 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
insanepyrokid Posted March 14, 2004 Author Share Posted March 14, 2004 No, that only checks if a different computer is online, it automatically returns 5 whether this computer is on or not. (i want to see if THIS computer has a current internet connection, not a different computer. thanks anyways Link to comment Share on other sites More sharing options...
Developers Jos Posted March 14, 2004 Developers Share Posted March 14, 2004 OK ... understand what you meand now... Could you check the @IPAddress1 thru @IPAddress4 to see if it gets and address assigned from you ISP ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ezzetabi Posted March 15, 2004 Share Posted March 15, 2004 (edited) here we are (untested) Edit: Tested! I inverted the 0 and the 1, ops... Now works. Func _IsThisComputerConnected() ; A function to know if a computer is connected or not. ; Returns ; 0 if the computer is Offline ; 1 if the computer is Online Local $ping Local $computername $computername = "www.altavista.com";----Altavista seems a good computer to check... :) ; Changed -w to 5000 because a "out-of-LAN" computer can need more time. RunWait(@comspec & " /c ping "& $computername &" -n 1 -w 5000>"& @tempdir &"\ping.tmp","",@sw_hide) $ping = FileReadLine(@tempdir &"\ping.tmp",13) FileDelete(@tempdir &"\ping.tmp") If StringInStr($ping,"(0%") Then Return 1 Else Return 0 EndIf EndFunc Edited March 15, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
MattNis Posted March 15, 2004 Share Posted March 15, 2004 (edited) You are forgetting an important, but easy to miss, fact that someone's computer may be behind a proxy. Then the ping command would never be successfull...it's not for me. There is an API command for getting internet connection status. Edited March 15, 2004 by MattNis [quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote] Link to comment Share on other sites More sharing options...
trids Posted March 23, 2004 Share Posted March 23, 2004 If you're simply checking your connectivity to the internet .. then why not just run a URLDownloadToFile (of say, www.google.com) .. and check the results? Link to comment Share on other sites More sharing options...
MattNis Posted March 23, 2004 Share Posted March 23, 2004 There is an API call to check if computer is connected to the internet. Any plans on incorporating it? [quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now