Here's another one without using any fancy IE or XML stuff. Just plain OS
functions...


CLEAR
? GetURLContent("http://www.atoutfox.org/ip.asp";, .T.)
? GetURLContent("http://ipecho.net/plain";)


************************************************************
FUNCTION GetURLContent
************************************************************
LPARAMETERS cURL, lBodyOnly

LOCAL cFile, cResult
cFile = REPLICATE(CHR(0), 260)
cResult = ""

DECLARE INTEGER URLDownloadToCacheFile IN urlmon;
        INTEGER lpUnkcaller, STRING szURL, STRING @szFileName,;
        INTEGER dwBufLength, INTEGER dwReserved, INTEGER pBSC

IF URLDownloadToCacheFile(0, cURL, @cFile, LEN(cFile), 0,0)  = 0
        cFile = RTRIM(cFile)
        cResult = FILETOSTR(cFile)
        DELETE FILE (cFile)
ENDIF

IF lBodyOnly
        cResult = STREXTRACT(cResult, "<body>", "</body>",1,1)
ENDIF

RETURN cResult


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/000201d644e8$a986bf10$fc943d30$@wondzinski.de
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to