Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi HTML Dokument laden (https://www.delphipraxis.net/9488-html-dokument-laden.html)

Gambit 27. Sep 2003 16:16


HTML Dokument laden
 
Hi!

Mit Response.Content:= 'Hallo Delphi Freunde'; würde ich ja ein HTML Dokument an den Client schicken mit besagtem Text. Wie aber kann ich eine vorhandene statische Seite an den Client schicken?
Response.Content:= 'Hallo.html' funzt ja nicht...

Gruß

Gambit

Chewie 27. Sep 2003 18:15

Re: HTML Dokument laden
 
Du liest die statische Seite in einen String und sendest den.

Gambit 27. Sep 2003 18:22

Re: HTML Dokument laden
 
Naja, dann könnte ich mir ja auch gleich die statische Seite in ein PageProducer Objekt schreiben und dessen Content senden. Ich hatte gedacht, es gäbe irgend eine Methode, mit der ich einfach auch statische Seiten senden kann...

Gruß

Gambit

ArrayOf.. 27. Sep 2003 18:35

Re: HTML Dokument laden
 
'geht, nämlich so:

AResponseInfo.ContentStream := TFileStream.Create(Filename,fmOpenRead);


Edit: ich gehe jetzt allerdings davon aus, dass du das bezüglich eines IdHTTPServer controls gefragt hast (weil es ja normalerweise dort AResponseInfo bzw. AResponseInfo.ContentText heißt).

Gambit 27. Sep 2003 18:54

Re: HTML Dokument laden
 
ja Danke!

War allerdings jetzt ein TWebResponse, müsste somit also Response.ContenStream(...) heissen, geht dann zumindest...

Gruß

Gambit


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:11 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz