?
Solved

vfp9  check if interent is on

Posted on 2012-08-31
2
Medium Priority
?
621 Views
Last Modified: 2012-09-01
Hi Experts

I would like to check if internet is connected before I run a routine.

Thanks
0
Comment
Question by:b001
2 Comments
 
LVL 3

Accepted Solution

by:
peterhupp earned 2000 total points
ID: 38354950
***************************************
Function ServerIsAvailable(tcUrlToCheck)
***************************************
Local llReturn
m.llReturn = .T.
If !Directory(tcUrlToCheck) && First check if it is a directory path, if not then assume it is an URL
   Declare Integer InternetCheckConnection In wininet;
      STRING lpszUrl,;
      INTEGER dwFlags,;
      INTEGER dwReserved
   If InternetCheckConnection(m.tcUrlToCheck, 1, 0) != 1
      m.llReturn = .F.
   Endif
Endif
Return m.llReturn
Endfunc

* source of this code is:
http://www.sweetpotatosoftware.com/spsblog/2008/02/15/VFPApplicationUpdatingMadeSimple.aspx
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 38355656
There's also InternetGetConnectedState(), which doesn't need a test URL. On the other side you will know what URL you want to navigate, so InternetCheckConnection() would do the trick. I`m not sure if it will give false positives for finding cached results from a URL in your browser cache or proxy for example.

Bye, Olaf.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question