Testing Internet

This forum is for eXpress++ general support.
Post Reply
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Testing Internet

#1 Post 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
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Testing Internet

#2 Post by rdonnay »

How do you intend to automatically download the file?
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Testing Internet

#3 Post 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.
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Testing Internet

#4 Post 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
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Testing Internet

#5 Post 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
Best regards,

Chris.
www.aboservice.be

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Testing Internet

#6 Post by BruceN »

thanks... I'll play with it in the next few days.
There are only 10 kinds of people - those who understand binary and those who don't :)

Post Reply