FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to Check web site
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
How to Check web site
Posted: Sun Aug 19, 2018 06:18 AM

Hi
How to check or know this web site page live or dead?

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to Check web site
Posted: Sun Aug 19, 2018 10:08 AM
Code (fw): Select all Collapse
? HB_PING( "www.google.com" )


EMG
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: How to Check web site
Posted: Tue Aug 21, 2018 02:42 PM

Hello Enrico, is it a function of xHarbour?

Saludos

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: How to Check web site
Posted: Tue Aug 21, 2018 03:44 PM
Code (fw): Select all Collapse
#include "FiveWin.ch"

Function PingFw( URL )

   LOCAL Hosts
   LOCAL wRet := .T.

   InetInit()
 
   If Empty( URL )

      URL := "www.google.com"

   Endif

   Hosts := InetGetHosts( URL )

   IF Hosts = nil .or. len(Hosts) = 0

      wRet := .F.

   Endif

   InetCleanup()

   ?  wRet

Return wRet
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion