<?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[GET Anfrage mit TCLientSocket?]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar habe ich vom BCB nur die Personal version, und da habe ich ja TCLientSocket dabei, meine Frage ist nun ob ich mit diesem TClientSocket zum Beispiel die Datei &quot;<a href="http://www.google.de/index.html" rel="nofollow">http://www.google.de/index.html</a>&quot; herunterladen kann, und diese dann in eine Datei speichern kann?</p>
<p>Wenn ja, kann mich bitte mal jemand auf den rechten weg weisen.</p>
<p>Vielen Dank im Voraus<br />
Lg freeze</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/89552/get-anfrage-mit-tclientsocket</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Jul 2026 18:35:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/89552.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Oct 2004 18:02:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Wed, 20 Oct 2004 18:02:20 GMT]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar habe ich vom BCB nur die Personal version, und da habe ich ja TCLientSocket dabei, meine Frage ist nun ob ich mit diesem TClientSocket zum Beispiel die Datei &quot;<a href="http://www.google.de/index.html" rel="nofollow">http://www.google.de/index.html</a>&quot; herunterladen kann, und diese dann in eine Datei speichern kann?</p>
<p>Wenn ja, kann mich bitte mal jemand auf den rechten weg weisen.</p>
<p>Vielen Dank im Voraus<br />
Lg freeze</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633606</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633606</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Wed, 20 Oct 2004 18:02:20 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Wed, 20 Oct 2004 18:32:23 GMT]]></title><description><![CDATA[<p>Na klar geht das. Du sendest ein GET und liest die Antwort des Servers aus.</p>
<p>Arbeite das Chat-Beispiel im \examples\internet-Verzeichnis des BCB durch und mach dich so mit TClientSocket vertraut. Wenn du dann soweit bist, einen Ansatz für dein GET-Problem zu entwerfen, dabei aber auf Schwierigkweiten stösst, dann helfen wir dir gern bei der konkreten Fehlersuche.</p>
<p>Alternativ kannst du auch einfach eine HTTP-Komponente wie die des Indy-Paketes verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633617</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 20 Oct 2004 18:32:23 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Wed, 20 Oct 2004 18:42:14 GMT]]></title><description><![CDATA[<p>Ja also das erste Problem hätte ich nämlich schon, und zwar schreibt mir windows immer eine Fehelrmeldung mit &quot;ASync Lookup&quot;, danach hatte ich den Code für das OnError Event implementiert den ich hier gefunden habe, nun schreibt er mir :&quot;Unspecified ClientSocket error.&quot;</p>
<p>Hier die Implementierung</p>
<pre><code class="language-cpp">void __fastcall TForm1::ClientSocket1Error(TObject *Sender,
      TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int &amp;ErrorCode)
{
  // analyse ErrorEvent
  String Msg = &quot;Unspecified ClientSocket error.&quot;;
  switch(ErrorEvent)
  {
    case eeGeneral :
      Msg = &quot;The socket received an error message that does not fit into any category.&quot;;
    case eeSend :
      Msg = &quot;An error occurred when trying to write to the socket connection.&quot;;
      break;
    case eeReceive :
      Msg =  &quot;An error occurred when trying to read from the socket connection.&quot;;
      break;
    case eeConnect :
      Msg = &quot;A connection request that was already accepted could not be completed.&quot;;
      break;
    case eeDisconnect :
      Msg = &quot;An error occurred when trying to close a connection.&quot;;
      break;
    case eeAccept :
      Msg = &quot;A problem occurred when trying to accept a client connection request.&quot;;
  }
  Application-&gt;MessageBox(Msg.c_str(), &quot;ClientSocket Error&quot;, MB_OK | MB_ICONSTOP);

  // prevent exception
  ErrorCode = 0;
}
</code></pre>
<p>Bei ClientSocket habe ich folgende Optionen eingestellt:</p>
<p>Active: false<br />
Address:<br />
ClientType: ctNonBlocking<br />
Host: <a href="http://www.google.de" rel="nofollow">http://www.google.de</a><br />
Name: ClientSocket1<br />
Port: 80<br />
Service:<br />
Tag: 0</p>
<p>Danach rufe ich bei einem Button-CLick die Open-Methode auf:</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender) {
  ClientSocket1-&gt;Open();
}
</code></pre>
<p>Lg freeze</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633620</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Wed, 20 Oct 2004 18:42:14 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Wed, 20 Oct 2004 19:41:14 GMT]]></title><description><![CDATA[<p>So auf den ersten Blick: das 'http://' gehört nicht zum Hostnamen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633661</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633661</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 20 Oct 2004 19:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Thu, 21 Oct 2004 07:20:25 GMT]]></title><description><![CDATA[<p>Nur mal ne frage am Rande.</p>
<p>Wäre unter Windoes dieser Code nicht besser um die Fehlermeldungen anzuzeigen?<br />
Damit wird die passende Windows Fehlermeldung zum Error Code ausgegen.</p>
<pre><code class="language-cpp">LPVOID lpMsgBuf;

FormatMessage(
    FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
    NULL,
    ErrorCode,
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    (LPTSTR) &amp;lpMsgBuf,
    0,
    NULL
 );

    ShowMessage((LPTSTR) lpMsgBuf);//Man kann natürlich auch MessageDlg usw nehmen.

    // Free the buffer.
    LocalFree( lpMsgBuf );
ErrorCode=0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/633845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633845</guid><dc:creator><![CDATA[Beliah]]></dc:creator><pubDate>Thu, 21 Oct 2004 07:20:25 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Thu, 21 Oct 2004 08:20:04 GMT]]></title><description><![CDATA[<p>Handelt es sich denn um Windows Errors? Aber du hast schon den richtigen Gedanken gehegt: Auch bei Borland-Exceptions gibt es eine eingebaute klartextnachricht...<br />
Aber die will man ja nicht immer haben sondern was eigenes dröseln? (o;</p>
<p>-junix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633876</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Thu, 21 Oct 2004 08:20:04 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Thu, 21 Oct 2004 09:12:28 GMT]]></title><description><![CDATA[<p>Bei den TServer/TClientSockets bin ich mir zu 99% sicher das die Error Codes Windows Codes sind.</p>
<p>Man kann ja beide Methoden kombinieren,bei ausgewählten Codes/ErrorEvents eine eigene Message, bei den anderen die von Windows, ist besser als &quot;Unspecified ClientSocket error.&quot; <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="😉"
    /><br />
Ausserdem werden die von Windows in der eingestellten Sprache angezeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633920</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633920</guid><dc:creator><![CDATA[Beliah]]></dc:creator><pubDate>Thu, 21 Oct 2004 09:12:28 GMT</pubDate></item><item><title><![CDATA[Reply to GET Anfrage mit TCLientSocket? on Thu, 21 Oct 2004 09:15:40 GMT]]></title><description><![CDATA[<p>Beliah schrieb:</p>
<blockquote>
<p>Bei den TServer/TClientSockets bin ich mir zu 99% sicher das die Error Codes Windows Codes sind.</p>
</blockquote>
<p>Klar. Macht ja auch sinn.. aber was machst du wenn da der Entwickler findet &quot;scheiss drauf ich mach das jetzt anders&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633925</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Thu, 21 Oct 2004 09:15:40 GMT</pubDate></item></channel></rss>