Page 1 of 1
Testing Internet
Posted: Sat Jun 05, 2010 2:18 pm
by BruceN
I'm trying to 'slicken' up our update procedures. Is there a way to test if there's a internet connection? The idea is that if there is a connection I can automatically download the file, if not prompt them for a location to look for it (which would have been downloaded elsewhere and brought in on a flash drive, etc.)
thanks,
bruce
Re: Testing Internet
Posted: Sun Jun 06, 2010 11:21 am
by rdonnay
How do you intend to automatically download the file?
Re: Testing Internet
Posted: Mon Jun 07, 2010 5:25 am
by BruceN
I use a library from Marshallsoft for ftp and email. It works great for me. If I try to download without a connection it tries for a bit then gives an error msg.
I'd prefer to be able to know whether or not to even try to download.
Re: Testing Internet
Posted: Mon Jun 07, 2010 6:16 am
by Tom
Hi, Bruce.
The "Windows Management Instrumentation" (WMI) should lead to a result. Look at the samples (active x) here:
http://www.activexperts.com/activmonito ... mi/samples
Re: Testing Internet
Posted: Mon Jun 07, 2010 6:36 am
by skiman
Hi Bruce,
The Marshalsoft functions always return a value. If that value is negative, then there is something wrong. You can test on them.
Code: Select all
Code = XfceConnect(0, @cServer, @cGebruiker, @cPassword)
if Code <0
XfceClose(0)
XfceRelease()
return .F.
endif
Code = XfceSetLocalDir(0, @cLocalDir)
if Code < 0
XfceClose(0)
XfceRelease()
sleep(200)
return .F.
endif
Code = XfceSetServerDir(0, @cServerDir)
if Code < 0
XfceClose(0)
XfceRelease()
sleep(200)
return .F.
endif
Re: Testing Internet
Posted: Tue Jun 08, 2010 2:30 pm
by BruceN
thanks... I'll play with it in the next few days.