Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine if internet connection exists? 1

Status
Not open for further replies.

HiBoo

Programmer
Jan 11, 2000
88
CA
What would be the easiest way to determine if a valid internet connection exists? I've got an A2K app that utilizes FTP commands to send a file to a remote site address. I use a Shell Object to execute a .bat file. The shell object returns a result which I can use to determine success or failure of the .bat file execution. What I need to know first though is if there is a valid internet connection prior to executing the shell object command. Some of my users are on a high speed connection all the time and I'll have no problem with them, its the one's who are still on dial up and may not be connected that I'd like to prevent problems with. If there is not connection then I'd have to prompt them to connect first before executing the shell object command.

Any suggestions would be appreciated.

Thanks,
 
Hi

I also haven't tried this.

But a quick idea would be a Shell Ping on the remote address.

U. R.
 
Thanks for the suggestions. Unfortunately the link was a bit too much for me to handle and the PING suggestion I'm not sure how to capture the results. The shell object returns true all the time when issuing the PING command because that's all it's supposed to do I think. How would one capture the results of the ping itself though. It will either TimeOut or be sucessful.

Still not sure if I'm connected???
 
Thanks beetee, that link would probably do the trick and I'll look further into it to see if I can streamline what I just found. Actually I was just going to update what I've found on another site. Your first suggestion got me thinking and I was able to resolve my problem using the following code from this link...

How to Ping an IP Address Using Visual Basic

I modified the code to utilize just the portion that tells me the results of the ping and it works just fine.

Thanks again for your help.[2thumbsup]
 
That's great. I think just learning that you can search the web for answers to just about anything is (for lack of a better word) empowering. Additionally, we should all feel a debt of gratitude for those who publish these answers.

I discovered Tek-Tips in a web search.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top