jk7800
Joined: 06 Jan 2008 Posts: 40 Location: Gdi+ v1.1
|
Posted: Sat Jun 28, 2008 3:42 pm Post subject: UrlDownloadToFile Problem |
|
|
Hi.
I'm making an Update Manager for one of my apps, but the UrlDownloadToFile function all the time sets the ErrorLevel to 1. Why does it not work?
I'm posting a modified version of my script (it's just an example, downloading the AutoHotkey logo).
The FileAppend function imitates a list of files to update (in the original script the list is downloaded from the update server).
| Code: | #Persistent
SetTimer, Update, 2000
Return
Update:
connected:=DllCall("Wininet.dll\InternetGetConnectedState", "Str", 0x40,"Int",0)
if connected
{
SetTimer, Update, OFF
FileAppend, http://www.autohotkey.com/docs/images/AutoHotkey_logo.gif?
logo.gif`nhttp://www.autohotkey.com/forum/templates/subSilver/images/folder.gif?gif.gif, Temp.txt
FileRead, UpdateList, Temp.txt
Loop, Parse, UpdateList, `n
{
StringSplit, UpdateFile, A_LoopField, ?
UrlDownloadToFile, %UpdateFile1%, %UpdateFile2%
msgbox, %ErrorLevel%
}
}
ExitApp |
_________________ My first app: Note
(Please, vote if you like my apps!)
None of my apps took me more than a day to create... After this time I get bored with it (maybe except the note one)... |
|