| |
|
|
| Have a problem - the Source shows by me the DeleteUrlCacheEntryA well only once - at first Male - whom cache deletes. at least see it so from because the Downloadabfragezeit only once long lasts - thereafter only yet 0ms. too the Result won't new loaded. If I but the URL z.B. NEN ?+st$(gettickcount) anhänge sustain I naturally each time one new - richtiges - Result. it sees means from as if DeleteUrlCacheEntryA not so operates How I it hope - nähhmlich simply always whom cache for URL delete.
What do I do wrong? its as though The Info on the Process glue - self one zweiter Thread deletes nothing. (tested with eigener DLL) CompileMarkSeparation {$cleq}
const url=http://ip.mxii.com
const target=ip.txt
cls
do {
getip()
settimer 1000
waitinput
killtimer
cls
}
end
getip {
long ms=gettickcount
external(wininet.dll,DeleteUrlCacheEntryA,url)
external(urlmon.dll,URLDownloadToFileA,0,url,target,0,0)
string s
assign #1,target
reset #1
input #1,s
close #1
erase #1
print ip:,s
print ms:,(gettickcount-ms)nt color=#0000FF>}
not XPSE-code: CompileMarkSeparationCLS
WHILE 1
GETIP()
SETTIMER 1000
WAITINPUT
KILLTIMER
CLS
ENDWHILE
end
PROC GETIP
var MS&=&GETTICKCOUNT
EXTERNAL(wininet.dll,DeleteUrlCacheEntryA,http://ip.mxii.com)
EXTERNAL(urlmon.dll,URLDownloadToFileA,0,http://ip.mxii.com,ip.txt,0,0)
var s$=
ASSIGN #1,ip.txt
RESET #1
INPUT #1,s$
CLOSE #1
ERASE #1
PRINT ip:,s$
PRINT ms:,(&GETTICKCOUNT-MS&)
endproc
|
|
|
| |
|
|
|
| I see I ahne URL$ isn't always the right lever for To löschende File - will be time whom Callback benefit circa to find out How the File in the cache itself name. |
|
|
| |
|
|
|
| OK the works Schonmal - time look How itself now the cache behave: CompileMarkSeparation {$cleq}
cls
print downloadfile(http://ip.mxii.com,ip.txt)
waitkey
end
DownloadFile (string url,destinationFileName){
string content=
long dllh=usedll(wininet.dll)
long hInet = external(wininet.dll,InternetOpenA,myapp,0,nil,nil,0);
//print hinet:,hinet
long hFile = external(wininet.dll,InternetOpenUrlA,hInet,addr(url),nil,0,$80000000,0);
//print hfile,hfile
mem buf=1024
//int fh=assign(destinationFileName)
//openrw fh
long bytesread
do {
external(wininet.dll,InternetReadFile,hFile,buf,1024,addr(bytesread))
//print read:,bytesread
if bytesread>0 {
content=content+char$(buf,0,bytesread)
//blockwrite fh,buf,0,bytesread
} else { break }
}
//closerw fh
external(wininet.dll,InternetCloseHandle,hFile)
external(wininet.dll,InternetCloseHandle,hInet)
dispose buf
freedll dllh
return c
}
|
|
|
| |
|
|
|
| working, no cache More. now can I the the Downloadunit procure... |
|
|
| |
|
|