InetGet 未按预期工作

发布于 2024-12-28 01:46:31 字数 383 浏览 1 评论 0原文

我编写了一个简单的修补程序应用程序,它将文件下载到配置的目录中。

当我通过修补程序从 URL 下载某些文件时,该 dll 文件所属的应用程序不会运行(当我单击“打开”时没有任何反应)。这是我的代码片段:

Local $fileDownload = InetGet("http://myurl.com/library.dll" , "library.dll" , 1 , 1)

一切都很好,如果我删除 library.dll AutoIt 就会下载它,但主应用程序不会运行。

如果我手动下载并替换文件(通过网络浏览器),一切都很好。所以看起来 InetGet() 损坏了文件。但我不知道如何以及为什么。

I wrote a simple patcher application which downloads a file into configured directory.

When I download some files from the URL via patcher, application which the dll file belongs to doesn't run (when I click 'open' nothing happens). Here is my code cut:

Local $fileDownload = InetGet("http://myurl.com/library.dll" , "library.dll" , 1 , 1)

Everything is fine, and if I remove the library.dll AutoIt is downloading it, but then the main application doesn't run.

If I download and replace the file manually (via web browser) everything is fine. So looks like InetGet() corrupts the file. But I don't know how and why.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柏拉图鍀咏恒 2025-01-04 01:46:31

inet_get 应该可以工作!无论如何,这是另一种方法,使用我的函数直接使用 winapi 方法下载文件,而不是将其保存到文件中

Func get_url($url)

    $RequestURL = $url;
    Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ;
    $oHTTP.Open("GET", $RequestURL, False)
    $oHTTP.Send()
     if  $oHTTP.status == 200 Then
           Return $oHTTP.ResponseText
     Else
            Return  "ooops... status: " & $oHTTP.status  
     EndIf

 EndFunc

inet_get should work! anyway here is another aproach download the file directly with winapi method using my function than save it to a file

Func get_url($url)

    $RequestURL = $url;
    Global $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ;
    $oHTTP.Open("GET", $RequestURL, False)
    $oHTTP.Send()
     if  $oHTTP.status == 200 Then
           Return $oHTTP.ResponseText
     Else
            Return  "ooops... status: " & $oHTTP.status  
     EndIf

 EndFunc
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文