Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Internet (https://www.clubdelphi.com/foros/forumdisplay.php?f=3)
-   -   Crear Archivo Html (https://www.clubdelphi.com/foros/showthread.php?t=57501)

lpedrazzi 17-06-2008 21:17:17

Crear Archivo Html
 
Buenas tardes estimados amigos del foro, les dejo una inquietud como puedo generar en el disco un archivo html a partir de un string, como por ejemplo este ....

S:=S + '<html>';
S:=S + '<head>';
S:=S + '</head>';
S:=S + '<body>';
S:=S + '<form name="HTTPSVI">';
S:=S + '<table width="477" height="20" border="0" cellspacing="0">';
S:=S + ' <tr>';
S:=S + ' <td width="18" height="27" class="big"></td>';
S:=S + ' </tr>';
S:=S + ' </table>';
S:=S + '</form>';
S:=S + '</body>';

maeyanes 17-06-2008 21:41:16

Hola...

La forma más rapida sería con un TStringList:

Código Delphi [-]
var
  HTMLFile: TStringList;

begin
  HTMLFile := TStringList.Create;
  try
    HTMLFile.Add('< html >');
    HTMLFile.Add('  < head >');
    // Insertar más líneas
    HTMLFile.Add('< /html >');
    HTMLFile.SaveToFile(c:\index.html')
  finally
    HTMLFile.Free
  end
end;


Saludos...


La franja horaria es GMT +2. Ahora son las 05:31:27.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi