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?
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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 52 guests