<?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[Was ist eine shtml-Datei?]]></title><description><![CDATA[<p>Hallo,</p>
<p>was genau ist eine .shtml-Datei und wie kann ich die anfordern? Wenn ich es mittels HTTP-GET versuche, bekomme ich immer nur die index.html.</p>
<p>Danke im voraus...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/65492/was-ist-eine-shtml-datei</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 15:05:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/65492.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Feb 2004 13:03:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 13:03:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>was genau ist eine .shtml-Datei und wie kann ich die anfordern? Wenn ich es mittels HTTP-GET versuche, bekomme ich immer nur die index.html.</p>
<p>Danke im voraus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463116</guid><dc:creator><![CDATA[Herr Hallmackenreuther]]></dc:creator><pubDate>Thu, 19 Feb 2004 13:03:50 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 13:12:17 GMT]]></title><description><![CDATA[<p>Eigentlich sollte es da keine Besonderheiten geben - zeig mal deinen Code...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463125</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 19 Feb 2004 13:12:17 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 13:53:52 GMT]]></title><description><![CDATA[<p>Hallo flenders,</p>
<p>hier der Code. Den hatte ich aus einem Tutorial entnommen. Wie gesagt, es funktioniert, aber ich bekomme immer nur die index.html.</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;string&gt;
#include &lt;winsock.h&gt;
#include &lt;io.h&gt;

#define HTTP_PORT 80

TCHAR   host[]  = &quot;host.name.de&quot;;
TCHAR   file[]  = &quot;status.shtml&quot;;

COORD   coord = { 80, 160 };

int main()
{
    int                 sock;
    struct sockaddr_in  host_addr;
    struct hostent      *hostinfo;
    char                command[1024];
    char                buf[1024];
    unsigned int        bytes_sent, bytes_recv;

    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coord);

    /* ggf. Winsock initialisieren */
    WSADATA wsaData;
    if (WSAStartup (MAKEWORD(1, 1), &amp;wsaData) != 0) {
        fprintf (stderr, &quot;WSAStartup(): Kann Winsock nicht initialisieren.\n&quot;);
        exit (EXIT_FAILURE);
    }

    /* Socket erzeugen */
    sock = socket (AF_INET, SOCK_STREAM, 0);
    if (sock == -1) {
        perror (&quot;socket()&quot;);
        exit (EXIT_FAILURE);
    }

    /* Adresse des Servers festlegen */
    memset( &amp;host_addr, 0, sizeof (host_addr));
    host_addr.sin_family = AF_INET;
    host_addr.sin_port = htons (HTTP_PORT);

    host_addr.sin_addr.s_addr = inet_addr (host);
    if (host_addr.sin_addr.s_addr == INADDR_NONE) {
        /* Server wurde nicht mit IP sondern mit dem Namen angegeben */
        hostinfo = gethostbyname (host);
        if (hostinfo == NULL) {
            perror (&quot;gethostbyname()&quot;);
            exit (EXIT_FAILURE);
        }
        memcpy((char*) &amp;host_addr.sin_addr.s_addr, hostinfo-&gt;h_addr, hostinfo-&gt;h_length);
    }

    /* Verbindung aufbauen */
    if (connect(sock, (struct sockaddr *) &amp;host_addr, sizeof(struct sockaddr)) == -1) {
        perror (&quot;connect()&quot;);
        exit (EXIT_FAILURE);
    }

    /* HTTP-GET-Befehl erzeugen */
    sprintf (command, &quot;GET %s HTTP/1.0\nHost: %s\n\n&quot;, file, host);

    /* Befehl senden */
    bytes_sent = send (sock, command, strlen (command), 0);
    if (bytes_sent == -1) {
        perror (&quot;send()&quot;);
        exit (EXIT_FAILURE);
    }

    // Antwort des Servers empfangen und ausgeben */
    while ((bytes_recv = recv (sock, buf, sizeof(buf), 0)) &gt; 0) {
        write (1, buf, bytes_recv);
    }
    if (bytes_recv == -1) {
        perror (&quot;recv()&quot;);
        exit (EXIT_FAILURE);
    }

    printf (&quot;\n&quot;);

    closesocket(sock);
    WSACleanup();

    return 0;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/463167</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463167</guid><dc:creator><![CDATA[Herr Hallmackenreuther]]></dc:creator><pubDate>Thu, 19 Feb 2004 13:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 14:00:34 GMT]]></title><description><![CDATA[<p>Setzte mal vor den Dateinamen noch einen Slash - auwßerdem gehört das nicht hier hin -&gt; verschoben nach WinAPI</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463174</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 19 Feb 2004 14:00:34 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 14:26:17 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/1644">@flenders</a>:</p>
<p>Herzlichen Dank, das war die Lösung. Könntest Du bitte noch erklären, was das Slash nun ändert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463200</guid><dc:creator><![CDATA[Herr Hallmackenreuther]]></dc:creator><pubDate>Thu, 19 Feb 2004 14:26:17 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 14:32:29 GMT]]></title><description><![CDATA[<p>Du musst eben wenn du ein Dokument anforderst den Pfad beginnend mit / übermitteln <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 />
Ohne Slash erkennt der Server offenbar nicht, was du haben willst und schickt dir das Standard-(Fehler-404?)-Dokument <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/463204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463204</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 19 Feb 2004 14:32:29 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 15:17:48 GMT]]></title><description><![CDATA[<p>/ ist das Root-Dir deines Benutzernamens (höher kommste nicht) (auf dem Server)<br />
./ ist das Verzeichnis in dem du dich gerade befindest (wo auf dem Server)<br />
../ ist das Verzeichnis über deinem aktuellen &quot;Standpunkt&quot;</p>
<p>scheinbar bist du mit deinem connect nicht im richtigen Verzeichnis gelandet.</p>
<p>mfg<br />
tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463269</guid><dc:creator><![CDATA[Tow-B.de]]></dc:creator><pubDate>Thu, 19 Feb 2004 15:17:48 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist eine shtml-Datei? on Thu, 19 Feb 2004 16:31:52 GMT]]></title><description><![CDATA[<p>wird für ein GET Request nicht immer der komplette Pfad verwendet? Ich würde denken, dass das ./ bzw. ../ oder einfach nur der Dateiname vom Browser einfach anhand des Pfades der aktuellen Datei ausgewertet wird, denn der Server weiß ja nichts davon, auf welcher Ebene ich mich befinde...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/463369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/463369</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 19 Feb 2004 16:31:52 GMT</pubDate></item></channel></rss>