Jump to content

Recommended Posts

Posted

Hello i have this code :

$info = "https://www.mywebsite.com/update/info.txt"
$sFilePath = @ScriptDir & "\update"
$Version = 2

$i = 0

SplashTextOn("", "Checking...Please Wait", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
While 1
    If InetGet($info, $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Then ExitLoop
    Sleep(1000)
    $i += 1
    If $i > 10 Then
        $error = 1
        ExitLoop
    EndIf
WEnd
SplashOff()

When i execute code any file is downloaded in my folder project folder "update"

Why please.

 

I don't have error ...

 

TY

Posted

:welcome:  to forum

#include <InetConstants.au3>
#include <Inet.au3>

$info = "https://www.autoitscript.com/forum/topic/210891-problem-with-inetget-and-download/#comment-1524929"
;~ $info = "https://www.mywebsite.com/update/info.txt"
$sFilePath = @ScriptDir & "\update.html"

; Download the file in the background with the selected option of 'force a reload from the remote site.'
Local $hDownload = InetGet($info, $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)

SplashTextOn("", "Checking...Please Wait", 450, 70, -1, -1, 0 + 1 + 16 + 32, "Times New Roman", 12, 800)
    Do     ; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
        Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    ; Close the handle returned by InetGet.
    InetClose($hDownload)
SplashOff()

ShellExecute($sFilePath)

 

I know that I know nothing

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...