www/web connect funcion or class?

www/web connect funcion or class?

Postby ShumingWang » Thu Apr 26, 2007 12:28 pm

Hi,
I want a function/class("www.myside.com/down/a1.exe","d:\myapp\tmp",loverwrite)
so easily support my app upgrade/download newfile from web site.

Thanks!
Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby R.F. » Thu Apr 26, 2007 2:59 pm

TURL class has what you're looking for.... available in xHarbour
Saludos
R.F.
R.F.
 
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Postby ShumingWang » Fri Apr 27, 2007 2:54 am

oUrl := tURL():New(“http://www.my.com/down/a1.dll")
get a crash.

Regards!

Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby ssbbs » Fri Apr 27, 2007 3:44 am

You can try this:

Code: Select all  Expand view  RUN
// author: ssbbs
// 下載更新紀錄
Func    GetModify()
Local   cFile   := "d:\myapp\tmp\a1.exe"
        If File(cFile)
           fErase(cFile)
        EndIf
        If URLDownloadToFile( 0, "www.myside.com/down/a1.exe", cFile, 0, 0 ) == 0
           msgInfo( "檔案取回成功", "OK" )
        Else
           MsgStop( "修改紀錄檔無法讀取!", "警告!" )
        EndIf
Return  NIL
DLL32   FUNCTION URLDownloadToFile(pCaller AS LONG,
                                                         szURL AS STRING,
                                                         szFileName AS STRING,
                                                         dwReserved AS LONG,
                                                         lpfnCB AS LONG);
        AS LONG PASCAL;
        FROM "URLDownloadToFileA";
        LIB "urlmon"
User avatar
ssbbs
 
Posts: 104
Joined: Mon Oct 17, 2005 3:03 am
Location: Taiwan

Postby ShumingWang » Fri Apr 27, 2007 7:07 am

Need FREELIBRARY( hLib ) ?

Thanks !
Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests