<?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[Es kommt nichts beim FTP Server an:-(]]></title><description><![CDATA[<p>Wie der Tital schon <a href="http://sagt.so" rel="nofollow">sagt.so</a> sieht der code aus:</p>
<pre><code class="language-cpp">//Internet Connection herstellen
        HINTERNET hFtp = InternetOpen(&quot;Application&quot;,
                                       INTERNET_OPEN_TYPE_DIRECT,
                                       NULL,
                                       NULL,
                                       INTERNET_FLAG_ASYNC);
        if(hFtp == NULL)
        {
                MessageBox(NULL, &quot;Error on Connect&quot;, &quot;Could not open&quot;, MB_OK);
                ExitProcess(0);
        }

                  hFtp = InternetConnect(hFtp,
                                         &quot;secondsun.homedns.org&quot;,
                                         21,
                                         &quot;anonymous&quot;,
                                         &quot;client@xxx.com&quot;,
                                         INTERNET_SERVICE_FTP,
                                         INTERNET_FLAG_PASSIVE,
                                         NULL);
        if(hFtp == NULL)
        {
                MessageBox(NULL, &quot;Error on Connect&quot;, &quot;Could not open&quot;, MB_OK);
                ExitProcess(0);
        }

        //Nach JPG`s scannen
        HANDLE fHandle;
        WIN32_FIND_DATA wfd;
        HANDLE hFileFind = FindFirstFile(TEXT(&quot;C:\\Dokumente und Einstellungen\\*.jpg&quot;), &amp;wfd);

        do
        {
                // Eintrag nur behandeln, wenn es nicht . oder .. ist (werden nur bei Unterverzeichnissen mit zurückgeliefert)
                // hier könnte man z.B. auch mit lstrcmp auf . und .. vergleichen, was allerdings nicht ganz so effizient ist
                if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
                {
                        if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
                        {
                                MessageBox(0,wfd.cFileName,&quot;Folgendes Verzeichnis wurde gefunden:&quot;,0);
                                // Datei ist keine, sondern ein Verzeichnis...
                                // Hier könnte man dasselbe nochmal machen, um auch die
                                // Unterverzeichnisse zu scannen ;-)
                        }
                        else
                        {
                                FtpPutFile(hFtp, wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL);
                                MessageBox(0, wfd.cFileName, (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY ? TEXT(&quot;Folgendes Verzeichnis wurde gefunden:&quot;) : TEXT(&quot;Folgendes Bild (jpg) wurde gefunden:&quot;)), MB_OK | MB_ICONINFORMATION);
                        }
                }

        }
        while (FindNextFile(hFileFind, &amp;wfd));
        FindClose(hFileFind);
        InternetCloseHandle(hFtp);

        return ;
}
//---------------------------------------------------------------------------
</code></pre>
<p>was ist falsch daran?ich habe ja auch die wininet lib drin und den header...es kompilierts ja auch richtig aber es kommt nichts in meinem ordner an</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/170350/es-kommt-nichts-beim-ftp-server-an</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 18:16:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/170350.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jan 2007 18:34:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Sun, 14 Jan 2007 18:34:29 GMT]]></title><description><![CDATA[<p>Wie der Tital schon <a href="http://sagt.so" rel="nofollow">sagt.so</a> sieht der code aus:</p>
<pre><code class="language-cpp">//Internet Connection herstellen
        HINTERNET hFtp = InternetOpen(&quot;Application&quot;,
                                       INTERNET_OPEN_TYPE_DIRECT,
                                       NULL,
                                       NULL,
                                       INTERNET_FLAG_ASYNC);
        if(hFtp == NULL)
        {
                MessageBox(NULL, &quot;Error on Connect&quot;, &quot;Could not open&quot;, MB_OK);
                ExitProcess(0);
        }

                  hFtp = InternetConnect(hFtp,
                                         &quot;secondsun.homedns.org&quot;,
                                         21,
                                         &quot;anonymous&quot;,
                                         &quot;client@xxx.com&quot;,
                                         INTERNET_SERVICE_FTP,
                                         INTERNET_FLAG_PASSIVE,
                                         NULL);
        if(hFtp == NULL)
        {
                MessageBox(NULL, &quot;Error on Connect&quot;, &quot;Could not open&quot;, MB_OK);
                ExitProcess(0);
        }

        //Nach JPG`s scannen
        HANDLE fHandle;
        WIN32_FIND_DATA wfd;
        HANDLE hFileFind = FindFirstFile(TEXT(&quot;C:\\Dokumente und Einstellungen\\*.jpg&quot;), &amp;wfd);

        do
        {
                // Eintrag nur behandeln, wenn es nicht . oder .. ist (werden nur bei Unterverzeichnissen mit zurückgeliefert)
                // hier könnte man z.B. auch mit lstrcmp auf . und .. vergleichen, was allerdings nicht ganz so effizient ist
                if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
                {
                        if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
                        {
                                MessageBox(0,wfd.cFileName,&quot;Folgendes Verzeichnis wurde gefunden:&quot;,0);
                                // Datei ist keine, sondern ein Verzeichnis...
                                // Hier könnte man dasselbe nochmal machen, um auch die
                                // Unterverzeichnisse zu scannen ;-)
                        }
                        else
                        {
                                FtpPutFile(hFtp, wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL);
                                MessageBox(0, wfd.cFileName, (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY ? TEXT(&quot;Folgendes Verzeichnis wurde gefunden:&quot;) : TEXT(&quot;Folgendes Bild (jpg) wurde gefunden:&quot;)), MB_OK | MB_ICONINFORMATION);
                        }
                }

        }
        while (FindNextFile(hFileFind, &amp;wfd));
        FindClose(hFileFind);
        InternetCloseHandle(hFtp);

        return ;
}
//---------------------------------------------------------------------------
</code></pre>
<p>was ist falsch daran?ich habe ja auch die wininet lib drin und den header...es kompilierts ja auch richtig aber es kommt nichts in meinem ordner an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209854</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Sun, 14 Jan 2007 18:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Sun, 14 Jan 2007 21:04:08 GMT]]></title><description><![CDATA[<p>Zeigt er dir denn die MessageBox's mit den Dateinamen an? Müsstest eig. noch ne Funktion nach InternetConnect vergessen haben ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209931</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 14 Jan 2007 21:04:08 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Sun, 14 Jan 2007 21:07:01 GMT]]></title><description><![CDATA[<p>guck mal in den thread system(&quot;ftp.exe&quot;);<br />
da ist mein problem beschrieben..also fehlen tut da eigentlich nichts es liegt einfach nur an der übergabe des dateinamens:-(</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209933</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Sun, 14 Jan 2007 21:07:01 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Sun, 14 Jan 2007 21:09:02 GMT]]></title><description><![CDATA[<p>ja den dateinamen zeig er an...ich glauube das probelm liegt daran das man den kompletten pfad angeben muss..also nehmen wir mal an das bild heiße ich.jpg dann übergibt der es als ich.jpg und nicht als C:\Dokumente und Einstellungen\ich.jpg was aber doof ist..denn jetzt stehe ich vor dem problem das ich herausfinden muss in welchen ordner das bild ist denn ich will es ja dynamisch machen und mich nicht auf ich.jpg beschränken</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209936</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Sun, 14 Jan 2007 21:09:02 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 13:48:46 GMT]]></title><description><![CDATA[<p>Wo ist dein Problem? Aja ... damit du auch in die Unterverzeichnisse noch gehen kannst um da zu suchen machs rekursiv ... nja so in etwa:</p>
<pre><code class="language-cpp">HINTERNET connect_to_server(LPCTSTR lpszServer, LPCTSTR lpszUserName, LPCTSTR lpszPassword)
{
	if (lpszServer == NULL || lpszUserName == NULL || lpszPassword == NULL)
		return NULL;

	HINTERNET hFtp = InternetOpen(TEXT(&quot;Application&quot;), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC);

	if (hFtp == NULL)
	{
		MessageBox(NULL, TEXT(&quot;Could not open internet session!&quot;), TEXT(&quot;Error&quot;), MB_OK | MB_ICONERROR);
		return NULL;
	}

	hFtp = InternetConnect(hFtp, lpszServer, 21, lpszUserName, lpszPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL);

	if (hFtp == NULL)
	{
		MessageBox(NULL, TEXT(&quot;Could not connect to FTP-Server!&quot;), NULL, MB_OK | MB_ICONERROR);
		return NULL;

	return hFtp;
}

bool upload_jpg_files(LPCTSTR lpszFolder)
{
	WIN32_FIND_DATA		wfd;
	TCHAR				szFilter[_MAX_PATH];
	_sntprintf(szFilter, _MAX_PATH - 1, TEXT(&quot;%s\\*.jpg&quot;), lpszFolder);
	HANDLE				hFileFind = FindFirstFile(szFilter, &amp;wfd);

	do
	{
		if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
		{
			if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
			{
				MessageBox(NULL, wfd.cFileName, &quot;Folgendes Verzeichnis wurde gefunden:&quot;, MB_OK | MB_ICONINFORMATION);
				TCHAR szSubPath[_MAX_PATH];
				_sntprintf(szSubPath, _MAX_PATH, TEXT(&quot;%s\\%s&quot;), lpszFolder, wfd.cFileName);
				upload_jpg_files(szSubPath); // So ... einfach an den alten Dateinamen noch den neuen Ordner dran hängen ...
			}
			else if (FtpPutFile(hFtp, wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL) != FALSE)
			{
				MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
			}
		}
	} while (FindNextFile(hFileFind, &amp;wfd));

	FindClose(hFileFind);

	return true;
}
</code></pre>
<p>Und nutzen tust du es in etwa so:</p>
<pre><code class="language-cpp">HINTERNET hFtp = connect_to_server(TEXT(&quot;secondsun.homedns.org&quot;), TEXT(&quot;anonymous&quot;), TEXT(&quot;client@xxx.com&quot;));
if (hFtp == NULL)
    return;

if (upload_jpg_files(TEXT(&quot;C:\\Dokumente und Einstellungen&quot;)) == false)
    MessageBox(NULL, TEXT(&quot;Could not upload files!&quot;), NULL, MB_OK | MB_ICONERROR);

InternetCloseHandle(hFtp);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1210250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210250</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 15 Jan 2007 13:48:46 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 14:00:20 GMT]]></title><description><![CDATA[<p>konstruktive antwort;-) ich werde es gleich mal ausprobieren;-) danke nochmal;-)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210259</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 14:00:20 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 14:50:45 GMT]]></title><description><![CDATA[<p>so ich bin nochmal...also der code sieht doch eigentlich super aus aber es kommen vier fehler bei mir:<br />
also so siehts aus:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream.h&gt;
#include &lt;wininet.h&gt;

int main()
{
        HINTERNET hFtp = connect_to_server(TEXT(&quot;secondsun.homedns.org&quot;), TEXT(&quot;anonymous&quot;), TEXT(&quot;client@xxx.com&quot;));
        if (hFtp == NULL)
        return 0;

        if (upload_jpg_files(TEXT(&quot;C:\\Dokumente und Einstellungen&quot;)) == false)
        MessageBox(NULL, TEXT(&quot;Could not upload files!&quot;), NULL, MB_OK | MB_ICONERROR);

        InternetCloseHandle(hFtp);
        return 0;
}

bool upload_jpg_files(LPCTSTR lpszFolder)
{
    WIN32_FIND_DATA       wfd;
    TCHAR                 szFilter[_MAX_PATH];
    _sntprintf(szFilter, _MAX_PATH - 1, TEXT(&quot;%s\\*.jpg&quot;), lpszFolder);
    HANDLE                hFileFind = FindFirstFile(szFilter, &amp;wfd);

    do
    {
        if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
        {
            if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
            {
                MessageBox(NULL, wfd.cFileName, &quot;Folgendes Verzeichnis wurde gefunden:&quot;, MB_OK | MB_ICONINFORMATION);
                TCHAR szSubPath[_MAX_PATH];
                _sntprintf(szSubPath, _MAX_PATH, TEXT(&quot;%s\\%s&quot;), lpszFolder, wfd.cFileName);
                upload_jpg_files(szSubPath); // So ... einfach an den alten Dateinamen noch den neuen Ordner dran hängen ...
            }
            else if (FtpPutFile(hFtp , wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL) != FALSE)
            {
                MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
            }
        }
    } while (FindNextFile(hFileFind, &amp;wfd));

    FindClose(hFileFind);

    return true;
}

HINTERNET connect_to_server(LPCTSTR lpszServer, LPCTSTR lpszUserName, LPCTSTR lpszPassword)
{
    if (lpszServer == NULL || lpszUserName == NULL || lpszPassword == NULL)
        return NULL;

    HINTERNET hFtp = InternetOpen(TEXT(&quot;Application&quot;), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not open internet session!&quot;), TEXT(&quot;Error&quot;), MB_OK | MB_ICONERROR);
        return NULL;
    }

    hFtp = InternetConnect(hFtp, lpszServer, 21, lpszUserName, lpszPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not connect to FTP-Server!&quot;), NULL, MB_OK | MB_ICONERROR);
        return NULL;

    return hFtp;
}
</code></pre>
<p>jetzt spuckt der compiler aber das hier aus:</p>
<pre><code class="language-cpp">
</code></pre>
<p>[C++ Fehler] Folder.cpp(8): E2268 Aufruf der undefinierten Funktion 'connect_to_server'<br />
[C++ Fehler] Folder.cpp(8): E2034 Konvertierung von 'int' nach 'void *' nicht möglich<br />
[C++ Fehler] Folder.cpp(12): E2268 Aufruf der undefinierten Funktion 'upload_jpg_files'<br />
[C++ Fehler] Folder.cpp(37): E2451 Undefiniertes Symbol 'hFtp'<br />
[C++ Warnung] Folder.cpp(69): W8066 Code wird nie erreicht<br />
[C++ Fehler] Folder.cpp(70): E2134 Abschließendes } fehlt<br />
[C++ Warnung] Folder.cpp(70): W8070 Funktion sollte einen Wert zurückgeben[cpp]<br />
was mache ich denn danoch falsch:-(??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210289</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 14:50:45 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 14:53:47 GMT]]></title><description><![CDATA[<p>sorry..hatte die letzte klammer schon eingesetzt aber die ersten 4 meldungen sind noch aktiv</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210292</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 14:53:47 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 15:16:49 GMT]]></title><description><![CDATA[<p>okay..also ich habe es etwas umgebaut...also erst mal habe ich bei jedem aufruf der upload_jpg_files noch den parameter hFtp übergeben weil er mir sagte das er nicht definiert ist...also er kompilierts auch vernünftig..doch ohne das gewünschte ergebnis.also ich habe es mal ein wenig umgebaut und hätte dazu noch ne frage:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream.h&gt;
#include &lt;wininet.h&gt;

bool upload_jpg_files(LPCTSTR lpszFolder, HINTERNET hFtp)
{
    WIN32_FIND_DATA       wfd;
    TCHAR                 szFilter[_MAX_PATH];
    _sntprintf(szFilter, _MAX_PATH - 1, TEXT(&quot;%s\\*.jpg&quot;), lpszFolder);
    HANDLE                hFileFind = FindFirstFile(szFilter, &amp;wfd);

    do
    {
        if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
        {
            if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
            {
                MessageBox(NULL, wfd.cFileName, &quot;Folgendes Verzeichnis wurde gefunden:&quot;, MB_OK | MB_ICONINFORMATION);
                TCHAR szSubPath[_MAX_PATH];
                _sntprintf(szSubPath, _MAX_PATH, TEXT(&quot;%s\\%s&quot;), lpszFolder, wfd.cFileName);
                upload_jpg_files(szSubPath, hFtp);
            }
            else if (FtpPutFile(hFtp , wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL) != FALSE)
            {
                MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
            }
        }
    } while (FindNextFile(hFileFind, &amp;wfd));

    FindClose(hFileFind);

    return true;
}

HINTERNET connect_to_server(LPCTSTR lpszServer, LPCTSTR lpszUserName, LPCTSTR lpszPassword)
{
    if (lpszServer == NULL || lpszUserName == NULL || lpszPassword == NULL)
        return NULL;

    HINTERNET hFtp = InternetOpen(TEXT(&quot;Application&quot;), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not open internet session!&quot;), TEXT(&quot;Error&quot;), MB_OK | MB_ICONERROR);
        return NULL;
    }

    hFtp = InternetConnect(hFtp, lpszServer, 21, lpszUserName, lpszPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not connect to FTP-Server!&quot;), NULL, MB_OK | MB_ICONERROR);
        return NULL;
    }

    return hFtp;
}

int main()
{
        HINTERNET hFtp = connect_to_server(TEXT(&quot;secondsun.homedns.org&quot;), TEXT(&quot;anonymous&quot;), TEXT(&quot;client@xxx.com&quot;));
        if (hFtp == NULL)
        return 0;

        if (upload_jpg_files(TEXT(&quot;C:\\Dokumente und Einstellungen&quot;), hFtp) == false)
        MessageBox(NULL, TEXT(&quot;Could not upload files!&quot;), NULL, MB_OK | MB_ICONERROR);

        InternetCloseHandle(hFtp);
        return 0;
}
</code></pre>
<p>so das erste was mir so auffiel war das:</p>
<pre><code class="language-cpp">else if (FtpPutFile(hFtp , wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL) != FALSE)
            {
                MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
            }
</code></pre>
<p>müssste es nicht so ein??</p>
<pre><code class="language-cpp">else if ((FtpPutFile(hFtp , wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL)) != FALSE)
            {
                MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
            }
</code></pre>
<p>oder vertu ich mich da nur..naja egal..er zeigt mir auf jeden fall schon mal ne message box an...nur mit ganz komischen zeichen im text...also unter C:\dokumenteundeinstellungen befinden sich bei mir 7 unterordner und ein test jpg aber as ich angezeigt bekomme ist ein komisches o mit nem strich drüber,ein kästchen und ein umgedrehtes t:-(</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210318</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 15:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 16:57:20 GMT]]></title><description><![CDATA[<p>Hmm nein es müsste nicht so sein... aber deine Header existieren in der Form nicht!</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;

HINTERNET connect_to_server(LPCTSTR, LPCTSTR, LPCTSTR);
bool upload_jpg_files(LPCTSTR, HINTERNET);

int main()
{
    HINTERNET hFtp = connect_to_server(TEXT(&quot;secondsun.homedns.org&quot;), TEXT(&quot;anonymous&quot;), TEXT(&quot;client@xxx.com&quot;));
    if (hFtp == NULL)
        return 0;

    if (upload_jpg_files(TEXT(&quot;C:\\Dokumente und Einstellungen&quot;), hFtp) == false)
        MessageBox(NULL, TEXT(&quot;Could not upload files!&quot;), NULL, MB_OK | MB_ICONERROR);

    InternetCloseHandle(hFtp);

    return 0;
}

HINTERNET connect_to_server(LPCTSTR lpszServer, LPCTSTR lpszUserName, LPCTSTR lpszPassword)
{
    if (lpszServer == NULL || lpszUserName == NULL || lpszPassword == NULL)
        return NULL;

    HINTERNET hFtp = InternetOpen(TEXT(&quot;Application&quot;), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not open internet session!&quot;), TEXT(&quot;Error&quot;), MB_OK | MB_ICONERROR);
        return NULL;
    }

    hFtp = InternetConnect(hFtp, lpszServer, 21, lpszUserName, lpszPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, NULL);

    if (hFtp == NULL)
    {
        MessageBox(NULL, TEXT(&quot;Could not connect to FTP-Server!&quot;), NULL, MB_OK | MB_ICONERROR);
        return NULL;
    }

    return hFtp;
}

bool upload_jpg_files(LPCTSTR lpszFolder, HINTERNET hFtp)
{
    WIN32_FIND_DATA       wfd;
    TCHAR                 szFilter[_MAX_PATH];
    _sntprintf(szFilter, _MAX_PATH - 1, TEXT(&quot;%s\\*.jpg&quot;), lpszFolder);
    HANDLE                hFileFind = FindFirstFile(szFilter, &amp;wfd);

    do
    {
        if (!((wfd.cFileName[0] == '.') &amp;&amp; ((wfd.cFileName[1] == '.' &amp;&amp; wfd.cFileName[2] == 0) || wfd.cFileName[1] == 0)))
        {
            if (wfd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
            {
                MessageBox(NULL, wfd.cFileName, &quot;Folgendes Verzeichnis wurde gefunden:&quot;, MB_OK | MB_ICONINFORMATION);
                TCHAR szSubPath[_MAX_PATH];
                _sntprintf(szSubPath, _MAX_PATH, TEXT(&quot;%s\\%s&quot;), lpszFolder, wfd.cFileName);
                if (upload_jpg_files(szSubPath, hFtp) == false)
                    return false;
            }
            else if (FtpPutFile(hFtp , wfd.cFileName, wfd.cFileName, FTP_TRANSFER_TYPE_BINARY, NULL) != FALSE)
            {
                MessageBox(NULL, wfd.cFileName, TEXT(&quot;Folgendes Bild (jpg) wurde hochgeladen:&quot;), MB_OK | MB_ICONINFORMATION);
            }
            else // Damit der dir die Funktion abbricht, falls die Datei nicht hochgeladen werden konnte ...
            {
                FindClose(hFileFind);
                return false;
            }
        }
    } while (FindNextFile(hFileFind, &amp;wfd));

    FindClose(hFileFind);

    return true;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1210372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210372</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 15 Jan 2007 16:57:20 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 17:10:53 GMT]]></title><description><![CDATA[<p>auf welches konto kann ich geld überweisen;-)???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210380</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210380</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 17:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Mon, 15 Jan 2007 19:10:45 GMT]]></title><description><![CDATA[<p>hi<br />
ich bin nochmal...ich galube es funktioniert doch noch nicht so wie ich es mir vorgestelllt hatte..also ich weiß nicht was ich für _sntprintf einsetzen soll.also ich benutze borland 6.0. hast du das ding mal bei dir kompiliert??(also falls du nen ftp hast) denn so richtig will das nicht.ich habe es dann auch mal mit</p>
<pre><code class="language-cpp">TCHAR  szFilter[MAX_PATH];
    wsprintf(szFilter, &quot;%s\\*.jpg&quot;, lpszFolder);
    HANDLE hFileFind = FindFirstFile(szFilter, &amp;wfd);
    MessageBox(0, szFilter, &quot;hallo&quot;, MB_OK);
</code></pre>
<p>also da geht ja noch aber spätestens in der schleife gibts probleme:</p>
<pre><code class="language-cpp">TCHAR szSubPath[MAX_PATH];
                wsprintf(szSubPath, &quot;%s\\%s&quot;, lpszFolder, wfd.cFileName);
                MessageBox(0, szSubPath, &quot;hallo&quot;, MB_OK);
</code></pre>
<p>jedoch habe ich da nicht was von MAX_PATH abgezogen(weil ich auch nicht mal so genau weiß wieso) ich verzweifel hier einfach:-( alles funktioniert..das durchsuchen der ordner nicht und dann im endeffekt auch das uploaden der daten:-(würde mich wirklich freuen wenn du dich der sache nochmal annehmen würdest,bitte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210433</guid><dc:creator><![CDATA[secondsun*gmx.de]]></dc:creator><pubDate>Mon, 15 Jan 2007 19:10:45 GMT</pubDate></item><item><title><![CDATA[Reply to Es kommt nichts beim FTP Server an:-( on Tue, 16 Jan 2007 16:47:51 GMT]]></title><description><![CDATA[<p>Naja ... du hast nicht wirklich einen Plan. Muss man einfach mal so sangen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Egal ... also _sntprintf ist eine sicherere Variante(von sprintf) die halt auch je nachdem ob du UNICODE oder nicht hast sich anpasst. Müsste eigentlich in tchar.h liegen.</p>
<p>Achja ... nein ich teste die Snippets die ich hier reinposte nie ... sind normal einfach so reingehauen ^^</p>
<pre><code class="language-cpp">TCHAR  szFilter[MAX_PATH]; // #if defined (UNICODE) typedef TCHAR wchar_t #else typedef TCHAR char #endif
wsprintf(szFilter, &quot;%s\\*.jpg&quot;, lpszFolder); // Wenn du jetzt keine UNICODE Anwendung hast wirds net funzen ...
HANDLE hFileFind = FindFirstFile(szFilter, &amp;wfd);
MessageBox(0, szFilter, &quot;hallo&quot;, MB_OK); // Goile Message -.-
</code></pre>
<p>Ist ja auch so ziemlich unsinnig ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210906</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210906</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Tue, 16 Jan 2007 16:47:51 GMT</pubDate></item></channel></rss>