I have upload an exe on a website, and I want my program auto download it after promt the auto update to the user, how to do it and what API I must use?
Look at this example here (http://spiff.tripnet.se/~iczelion/files/http15.zip).
Good luck!
You can simplify your work with API UrlDownloadToFile (see in example 12 in Masm package) or using Wininet :
GetWinInetFile PROTO :DWORD,:DWORD
.code
; Success == 1, 0 == error
GetWinInetFile PROC fUrl,fSav:DWORD
LOCAL hUrl,fHand,bwrite,szBuffer,hSession: DWORD
LOCAL Buffer[1024]: BYTE
mov hSession, FUNC (InternetOpen,chr$('toto'),INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,NULL)
.if hSession != 0
mov hUrl,FUNC (InternetOpenUrl,hSession,fUrl,NULL,NULL,NULL,NULL)
.if hUrl != 0
mov fHand, FUNC (CreateFile,fSav,GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0)
.if fHand != INVALID_HANDLE_VALUE
inc szBuffer
.WHILE szBuffer != 0
invoke InternetReadFile,hUrl,addr Buffer,sizeof Buffer,addr szBuffer
invoke WriteFile,fHand,addr Buffer,szBuffer,ADDR bwrite,NULL
.ENDW
invoke CloseHandle,fHand
invoke InternetCloseHandle,hUrl
invoke InternetCloseHandle,hSession
.endif
.endif
.endif
ret
GetWinInetFile ENDP
Thanks. I will ty it.