Autor Beitrag
pk910
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Fr 29.12.06 22:31 
Wenn ich eine Verbindung zu nem HTML
Server (Port 80) über ein ClientSocket aufbaue,
was muss ich an den Server schicken, damit
der mir den Quelltext schickt?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 29.12.06 23:04 
GET und dann den Dateinamen (IMHO)

Nimm doch einfach idHTTP!

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Fr 29.12.06 23:23 
Ich will eig. ohne idHTTP auskommen ;)

Noch ne Frage:
Kann ich die Antwort mit Socket.ReceiveText empfangen? weil es kommt nichts an...

So sieht mein Befehl aus: GET seite.htm
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Fr 29.12.06 23:46 
Ich glaub du musst nen Zeilenumbruch (vllt. auch 2, ka) senden, als Zeichen dass das Kommando fertig ist.

//EDIT: tools.ietf.org/html/rfc2616

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Fr 23.02.07 22:47 
ok...
Jetzt antwortet der Server mal...
aber bei

GETindex.php
gibts diese Antwort:
Zitat:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Cannot process request!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Cannot process request!</h1>
<p>


The server does not support the action requested by the browser.

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:%5bno%20address%20given%5d">webmaster</a>.

</p>

<h2>Error 501</h2>
<address>

<span>Fri Feb 23 21:41:41 2007<br />
Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e</span>
</address>
</body>
</html>


und
GET index.php

geht auch ned

wie gweht der Befehl richtig?
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Sa 24.02.07 12:08 
Probier mal

GET index.php HTTP/1.0
Host: ...

Für ... die Domain einsetzen.

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
BlumenhunD
Hält's aus hier
Beiträge: 5


Delphi / Enterprise
BeitragVerfasst: Sa 24.02.07 13:43 
du könntest die datei auch in nem TWebBrowser öffnen
und per
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var tr: IHTMLTxtRange;
    s:string
begin
 if (NOT WebBrowser1.Busy) then begin
   tr := (WebBrowser1.Document as IHTMLDocument2).body as 
IHTMLBodyElement).createTextRange;
   s:=tr.Text;
end;
end;


das rufst du bei WebBrowser1DocumentComplete auf fertig ^^

_________________
viele liebe Grüße
vom BlumenhunD :D
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Sa 24.02.07 14:24 
Moin!

user profile iconpk910 hat folgendes geschrieben:
Kann ich die Antwort mit Socket.ReceiveText empfangen?

Grundsätzlich ja, aber vorsicht: wenn die Antwort des Servers insgesamt >8kb ist, kommt die Datei in 8kb-Stückchen. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.