FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TIP and TipClientHttp() class
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
TIP and TipClientHttp() class
Posted: Sat Nov 01, 2008 05:12 PM

Antonio and friends,

How I can obtain a manual for TIP class? I need to use tipClientHttp() and your method ::open()... but this not works.

Please, someone can help me?

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TIP and TipClientHttp() class
Posted: Sat Nov 01, 2008 05:36 PM
Hi JC,

I have not tested yet. It is given from someone of this forum. It may help you.

IF wfReadURL("http://www.test.be/test.txt") # "Error opening" 
   ... File is there 
ELSE 
   ... File is not there 
ENDIF 

FUNCTION wfReadURL(cUrl) 
  LOCAL cPageContent:="Error: " + cUrl + " not found or timed out." 
  LOCAL oConn 
  
  IF Upper(Left(cUrl,4))#"HTTP" 
     cUrl:="http://"+cUrl 
  ENDIF 
  
  TRY 
  
   oConn := TipClientHttp():New(TURL():New(cUrl)) 
   oConn:nConnTimeout := 20000 

   IF oConn:Open(cURL) 
      cPageContent := oConn:ReadAll() 
      oConn:Close() 
   ENDIF 
    
  CATCH 
   cPageContent:="Error opening " + cUrl 
    
  END 
  
RETURN cPageContent 

//================================================================================ 
FUNCTION wfSaveURL(cUrl,cSaveAs) 

  LOCAL cPageContent:=wfReadURL(cUrl) 
  LOCAL lReturn:=.T. 
  
  IF cPageContent="Error:" 
     lReturn:=.F. 
  ELSE 
     MemoWrite(cSaveAs,cPageContent) 
     IF !File(cSaveAs) 
        lReturn:=.T. 
     ENDIF    
  ENDIF 
  
RETURN lReturn
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
TIP and TipClientHttp() class
Posted: Sat Nov 01, 2008 05:45 PM

Hakan,

I use transparent proxy for my connection... is necessary to define the server and port of my proxy to tip class?

If yes, how I can do?

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9

Continue the discussion