<?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[Ftp Verbindung zu Server aufnehmen nach Userinput]]></title><description><![CDATA[<p>Hi<br />
Ich möchte dass der Benutzer Angaben machen kann und das Programm dann zu diesem Server verbindet</p>
<p>Hier ist das Originalprogramm was sich auch einwandfrei kompilieren laesst und funktioniert</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#include &lt;process.h&gt; 
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;wininet.h&gt;
#pragma comment(lib, &quot;Wininet.lib&quot;)
#pragma comment(lib, &quot;ws2_32&quot;)
#pragma comment(lib, &quot;libwininet.a&quot;)

using namespace std;

void upload(void);

int main()
{

        upload();

}

void upload()
{
    HINTERNET hOpen, hConnection;

    hOpen = InternetOpen(&quot;FTP Upload&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

    hConnection = InternetConnect(hOpen, &quot;server&quot;, INTERNET_DEFAULT_FTP_PORT,
                                     &quot;acc&quot;, &quot;pw&quot;, INTERNET_SERVICE_FTP, 0, 0);

    FtpPutFile(hConnection, &quot;C:\\upload.txt&quot;, &quot;//upload.txt&quot;,
                  FTP_TRANSFER_TYPE_ASCII, 0);

    InternetCloseHandle(hConnection);
    InternetCloseHandle(hOpen);
}
</code></pre>
<p>Das hab ich dann versucht umzugestalten:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#include &lt;process.h&gt; 
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;wininet.h&gt;
#pragma comment(lib, &quot;Wininet.lib&quot;)
#pragma comment(lib, &quot;ws2_32&quot;)
#pragma comment(lib, &quot;libwininet.a&quot;)

using namespace std;

void upload(void);

int main()
{
char server[50];
char account[50];
char passwort[50]; 

cin.getline(server,50); 
cin&gt;&gt;account;
cin&gt;&gt;passwort;
        upload();

}

void upload()
{
    HINTERNET hOpen, hConnection;

    hOpen = InternetOpen(&quot;FTP Upload&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

    hConnection = InternetConnect(hOpen, &quot;&quot;&lt;&lt;server&lt;&lt;&quot;, INTERNET_DEFAULT_FTP_PORT,
                                     &quot;&quot;&lt;&lt;acc&lt;&lt;&quot;&quot;, &quot;&quot;&lt;&lt;pw&lt;&lt;&quot;&quot;, INTERNET_SERVICE_FTP, 0, 0);

    FtpPutFile(hConnection, &quot;C:\\upload.txt&quot;, &quot;//upload.txt&quot;,
                  FTP_TRANSFER_TYPE_ASCII, 0);

    InternetCloseHandle(hConnection);
    InternetCloseHandle(hOpen);
}
</code></pre>
<p>Funktioniert leider nicht <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>
<p>Kann mir jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173164/ftp-verbindung-zu-server-aufnehmen-nach-userinput</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 01:20:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173164.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Feb 2007 15:20:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Mon, 12 Feb 2007 15:20:12 GMT]]></title><description><![CDATA[<p>Hi<br />
Ich möchte dass der Benutzer Angaben machen kann und das Programm dann zu diesem Server verbindet</p>
<p>Hier ist das Originalprogramm was sich auch einwandfrei kompilieren laesst und funktioniert</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#include &lt;process.h&gt; 
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;wininet.h&gt;
#pragma comment(lib, &quot;Wininet.lib&quot;)
#pragma comment(lib, &quot;ws2_32&quot;)
#pragma comment(lib, &quot;libwininet.a&quot;)

using namespace std;

void upload(void);

int main()
{

        upload();

}

void upload()
{
    HINTERNET hOpen, hConnection;

    hOpen = InternetOpen(&quot;FTP Upload&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

    hConnection = InternetConnect(hOpen, &quot;server&quot;, INTERNET_DEFAULT_FTP_PORT,
                                     &quot;acc&quot;, &quot;pw&quot;, INTERNET_SERVICE_FTP, 0, 0);

    FtpPutFile(hConnection, &quot;C:\\upload.txt&quot;, &quot;//upload.txt&quot;,
                  FTP_TRANSFER_TYPE_ASCII, 0);

    InternetCloseHandle(hConnection);
    InternetCloseHandle(hOpen);
}
</code></pre>
<p>Das hab ich dann versucht umzugestalten:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#include &lt;process.h&gt; 
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;wininet.h&gt;
#pragma comment(lib, &quot;Wininet.lib&quot;)
#pragma comment(lib, &quot;ws2_32&quot;)
#pragma comment(lib, &quot;libwininet.a&quot;)

using namespace std;

void upload(void);

int main()
{
char server[50];
char account[50];
char passwort[50]; 

cin.getline(server,50); 
cin&gt;&gt;account;
cin&gt;&gt;passwort;
        upload();

}

void upload()
{
    HINTERNET hOpen, hConnection;

    hOpen = InternetOpen(&quot;FTP Upload&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

    hConnection = InternetConnect(hOpen, &quot;&quot;&lt;&lt;server&lt;&lt;&quot;, INTERNET_DEFAULT_FTP_PORT,
                                     &quot;&quot;&lt;&lt;acc&lt;&lt;&quot;&quot;, &quot;&quot;&lt;&lt;pw&lt;&lt;&quot;&quot;, INTERNET_SERVICE_FTP, 0, 0);

    FtpPutFile(hConnection, &quot;C:\\upload.txt&quot;, &quot;//upload.txt&quot;,
                  FTP_TRANSFER_TYPE_ASCII, 0);

    InternetCloseHandle(hConnection);
    InternetCloseHandle(hOpen);
}
</code></pre>
<p>Funktioniert leider nicht <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>
<p>Kann mir jemand helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227478</guid><dc:creator><![CDATA[fgdsgfdhgjhfg]]></dc:creator><pubDate>Mon, 12 Feb 2007 15:20:12 GMT</pubDate></item><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Mon, 12 Feb 2007 15:37:57 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void upload(char *server, char *account, char *passwort);
...
InternetConnect(hOpen, server, INTERNET_DEFAULT_FTP_PORT, account, passwort, ...);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1227488</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227488</guid><dc:creator><![CDATA[keksekekse]]></dc:creator><pubDate>Mon, 12 Feb 2007 15:37:57 GMT</pubDate></item><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Mon, 12 Feb 2007 15:56:03 GMT]]></title><description><![CDATA[<p>Erstma thx fuer Hilfe</p>
<p>Leider kommen noch diese Errors:</p>
<p>32 expected unqualified-id before '{' token<br />
32 expected <code>,' or</code>;' before '{' token</p>
<p>Bezieht sich auf diese Zeile</p>
<p>void upload(char *server, char *account, char *passwort);<br />
{ (---</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227503</guid><dc:creator><![CDATA[FDHFGJ]]></dc:creator><pubDate>Mon, 12 Feb 2007 15:56:03 GMT</pubDate></item><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Mon, 12 Feb 2007 16:00:17 GMT]]></title><description><![CDATA[<p>falls upload() eine definition ist, ist das semikolon zu falsch<br />
siehe: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-61231.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-61231.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1227506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1227506</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 12 Feb 2007 16:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Sun, 03 Jun 2012 19:24:17 GMT]]></title><description><![CDATA[<p>Bei mir wird das erste Programm auch nicht kompiliert. Bei mir kommen folgende Fehlermeldungen:</p>
<blockquote>
<p>Fehler 1 error C2664: 'InternetOpenW': Konvertierung des Parameters 1 von 'const char [11]' in 'LPCWSTR' nicht möglich c:\users\administrator\documents\visual studio 2008\projects\1\1\1.cpp 31<br />
Fehler 2 error C2664: 'InternetConnectW': Konvertierung des Parameters 2 von 'const char [7]' in 'LPCWSTR' nicht möglich c:\users\administrator\documents\visual studio 2008\projects\1\1\1.cpp 34<br />
Fehler 3 error C2664: 'FtpPutFileW': Konvertierung des Parameters 2 von 'const char [14]' in 'LPCWSTR' nicht möglich c:\users\administrator\documents\visual studio 2008\projects\1\1\1.cpp 36</p>
</blockquote>
<p>Woran liegt das und wie kann ich das ändern hab' leider noch nicht so viel Ahnung von der Api.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1692505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1692505</guid><dc:creator><![CDATA[Hunterson]]></dc:creator><pubDate>Sun, 03 Jun 2012 19:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to Ftp Verbindung zu Server aufnehmen nach Userinput on Wed, 08 Apr 2009 21:12:27 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also echt...<br />
einfach mal nach &quot;Konvertierung 'const char []' in 'LPCWSTR'&quot; oder &quot;LPCWSTR&quot; suchen. Wurde im Board schon so oft angesprochen das Thema.</p>
<p>Blessed Love C0de4Fun</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1693151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1693151</guid><dc:creator><![CDATA[C0de4Fun]]></dc:creator><pubDate>Wed, 08 Apr 2009 21:12:27 GMT</pubDate></item></channel></rss>