<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Datei Download?]]></title><description><![CDATA[<p>Hallo,ich brauche einen Code um eine Datei aus dem Internet zu downloaden und auf der Festplatte zu speichern? Ich habe es schon mit URLDownloadToFile probiert da fehlt mir aber irgendwie die &quot;Urlmon.h&quot; und die Lib fehlt mir auch. Meine Entwicklungsumgebung ist Dev-C++. Und ich würde das gerne in C machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/195712/datei-download</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 20:02:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/195712.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 20 Oct 2007 21:28:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei Download? on Sat, 20 Oct 2007 21:28:07 GMT]]></title><description><![CDATA[<p>Hallo,ich brauche einen Code um eine Datei aus dem Internet zu downloaden und auf der Festplatte zu speichern? Ich habe es schon mit URLDownloadToFile probiert da fehlt mir aber irgendwie die &quot;Urlmon.h&quot; und die Lib fehlt mir auch. Meine Entwicklungsumgebung ist Dev-C++. Und ich würde das gerne in C machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1389185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1389185</guid><dc:creator><![CDATA[Dry Gin]]></dc:creator><pubDate>Sat, 20 Oct 2007 21:28:07 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Download? on Sat, 20 Oct 2007 21:57:46 GMT]]></title><description><![CDATA[<p><a href="http://msdn2.microsoft.com/en-us/library/aa384322.aspx#Downloading_resource" rel="nofollow">http://msdn2.microsoft.com/en-us/library/aa384322.aspx#Downloading_resource</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1389195</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1389195</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Sat, 20 Oct 2007 21:57:46 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Download? on Sun, 21 Oct 2007 09:34:07 GMT]]></title><description><![CDATA[<p>lad dir mal das neuste winapi paket von <a href="http://mingw.org" rel="nofollow">mingw.org</a> runter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1389248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1389248</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Sun, 21 Oct 2007 09:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Download? on Sun, 21 Oct 2007 09:37:51 GMT]]></title><description><![CDATA[<p>oh sorry habe gerade nachgeguckt, auch im neusten paket ist die urlmon.h noch nicht drin. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1389249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1389249</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Sun, 21 Oct 2007 09:37:51 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Download? on Sun, 21 Oct 2007 15:13:45 GMT]]></title><description><![CDATA[<p>Hier abba nur weil ich gut drauf bin .. das ganze funzt mit einer config.dat in der in der ersten Zeile der direkte downloadlink von Http steht</p>
<pre><code class="language-cpp">//Header
#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;tchar.h&gt;
#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#include &lt;fstream&gt;
//Namespace
using namespace std;

// die wininet.lib linken
#pragma comment(lib, &quot;wininet.lib&quot;)

int Downloader::download()
{
    std::string line;
    ifstream file_stream(&quot;Data/config.dat&quot;);
    if (!file_stream)
        return false;
    while (std::getline(file_stream, line))
    {

        HINTERNET hInet = InternetOpen(_T(&quot;MyAppName&quot;), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
        if(hInet != NULL)
        {
            // Verbindung zum Server herstellen
            LPCTSTR httpFile = line.c_str();
            HINTERNET hRemoteFile = InternetOpenUrl(hInet,httpFile, NULL, 0, INTERNET_FLAG_RELOAD, 0);
            if(hRemoteFile != NULL)
            {
                // die lokale Datei erzeugen, in die wir schreiben werden
                HANDLE hLocalFile = CreateFile(_T(&quot;repack.exe&quot;), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); //Repack.exe ist nur ein Beispiel wie soll die Datei heißen und welcher Pfad vielleicht C: ? Dir überlassen!
                if(hLocalFile != NULL)
                {
                    // solange Daten verfügbar sind...
                    DWORD numberOfBytesAvailable = 0;
                    while(InternetQueryDataAvailable(hRemoteFile, &amp;numberOfBytesAvailable, 0, 0))
                    {
                        if(numberOfBytesAvailable &gt; 0)
                        {
                            // ...allokiere einen Puffer...
                            LPVOID pBuffer = malloc(numberOfBytesAvailable);

                            // ...und fülle ihn mit den verfügbaren Daten
                            DWORD numberOfBytesRead = 0;
                            if(InternetReadFile(hRemoteFile, pBuffer, numberOfBytesAvailable, &amp;numberOfBytesRead) == FALSE)
                            {
                                // TODO: Fehlerbehandlung
                            }
                            if(numberOfBytesRead != numberOfBytesAvailable)
                            {
                                // TODO: Fehlerbehandlung
                            }
                            // empfangene Daten in die lokale Datei schreiben
                            DWORD numberOfBytesWritten = 0;
                            if(WriteFile(hLocalFile, pBuffer, numberOfBytesRead, &amp;numberOfBytesWritten, NULL) == FALSE)
                            {
                                // TODO: Fehlerbehandlung
                            }
                            if(numberOfBytesWritten != numberOfBytesRead)
                            {
                                // TODO: Fehlerbehandlung
                            }

                            // Puffer wieder freigeben
                            free(pBuffer);
                        }
                        else
                        {
                            break;
                        }
                    }

                    // das Handle freigeben
                    CloseHandle(hLocalFile);
                }

                // das Handle freigeben
                InternetCloseHandle(hRemoteFile);
            }

            // das Handle freigeben
            InternetCloseHandle(hInet);
        }
        return 0;
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1389394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1389394</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Sun, 21 Oct 2007 15:13:45 GMT</pubDate></item><item><title><![CDATA[Reply to Datei Download? on Tue, 23 Oct 2007 19:21:38 GMT]]></title><description><![CDATA[<blockquote>
<p>Und ich würde das gerne in C machen.</p>
</blockquote>
<p>*Hust*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1390803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1390803</guid><dc:creator><![CDATA[Dry Gin]]></dc:creator><pubDate>Tue, 23 Oct 2007 19:21:38 GMT</pubDate></item></channel></rss>