<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Определение размера файла в сети]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=6324</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6324&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Определение размера файла в сети».]]></description>
		<lastBuildDate>Mon, 17 Oct 2011 20:00:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Определение размера файла в сети]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52587#p52587</link>
			<description><![CDATA[<p>У меня вот так получилось:<br /></p><div class="codebox"><pre><code>url = http://www.autohotkey.net/~Lexikos/AutoHotkey_L/AutoHotkey_L_Install.exe
 
MsgBox, % GetFileSizeFromInternet(url)   ; размер в байтах
 
GetFileSizeFromInternet(url, ProxyName = &quot;&quot;, ProxyBypass = &quot;&quot;)
{
   INTERNET_OPEN_TYPE_DIRECT = 1
   INTERNET_OPEN_TYPE_PROXY = 3
   AccessType := ProxyName ? INTERNET_OPEN_TYPE_DIRECT : INTERNET_OPEN_TYPE_PROXY
   INTERNET_FLAG_RELOAD = 0x80000000
   HTTP_QUERY_CONTENT_LENGTH = 5
   coding := A_IsUnicode ? &quot;W&quot; : &quot;A&quot;
 
   hModule := DllCall(&quot;LoadLibrary&quot;, Str, &quot;wininet.dll&quot;)
   hInternet := DllCall(&quot;wininet\InternetOpen&quot; . coding
                  , Str, &quot;&quot;   
                  , UInt, INTERNET_OPEN_TYPE_DIRECT
                  , Str, &quot;&quot;
                  , Str, &quot;&quot;
                  , UInt, 0)
   if !hInternet
   {
      Error := A_LastError
      DllCall(&quot;FreeLibrary&quot;, UInt, hModule)
      Return &quot;Ошибка &quot; . Error
   }
 
   hFile := DllCall(&quot;wininet\InternetOpenUrl&quot; . coding
               , UInt, hInternet
               , Str, url
               , Str, &quot;&quot;
               , UInt, 0
               , UInt, INTERNET_FLAG_RELOAD
               , UInt, 0)
   if !hFile
   {
      Error := A_LastError
      DllCall(&quot;wininet\InternetCloseHandle&quot;, UInt, hInternet)
      DllCall(&quot;FreeLibrary&quot;, UInt, hModule)
      Return &quot;Ошибка &quot; . Error
   }
 
   VarSetCapacity(buff, 64)
   VarSetCapacity(bufflen, 2)
   Loop 4
   {
      success := DllCall(&quot;wininet\HttpQueryInfo&quot; . coding
                  , UInt, hFile
                  , UInt, HTTP_QUERY_CONTENT_LENGTH
                  , UInt, &amp;buff
                  , UInt, &amp;bufflen
                  , UInt, 0)
      if success
         Break
   }
   Result := success ? StrGet(&amp;buff) : &quot;Невозможно извлечь информацию&quot;
 
   DllCall(&quot;wininet\InternetCloseHandle&quot;, UInt, hInternet)
   DllCall(&quot;wininet\InternetCloseHandle&quot;, UInt, hFile)
   DllCall(&quot;FreeLibrary&quot;, UInt, hModule)
 
   Return Result
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 17 Oct 2011 20:00:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52587#p52587</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Определение размера файла в сети]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52572#p52572</link>
			<description><![CDATA[<p>При использовании <em>urldownloadtofile</em> такой возможности, кажется, нет. Зато можно сделать звуковой сигнал или окно с сообщением сразу после загрузки файла.</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Mon, 17 Oct 2011 15:04:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52572#p52572</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Определение размера файла в сети]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=52566#p52566</link>
			<description><![CDATA[<p>Доброго времени суток уважаемые участники форума:)<br />пишу я скриптик. одной из его задач является скачивание файлика с интернета.<br />для проверки, полностью ли докачался файл мне нужно узнать его размер чтобы потом сравнить со скаченным.<br />FileGetSize,var,http://блаблабла.exe ничего умного не приносит.</p><p>Как же быть?</p>]]></description>
			<author><![CDATA[null@example.com (Footman)]]></author>
			<pubDate>Mon, 17 Oct 2011 07:58:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=52566#p52566</guid>
		</item>
	</channel>
</rss>
