CONST
FHead= '<html><head><meta http-equiv="Content-Type" content="text/html;'+
' charset=gb2312"></head>';
FBody='<body>';
FEnd = '</body></html>';
Var
Fhtm:TextFile;
TxtStrings:TStringList;
i:integer;
begin
Fh:='C:/bbb.htm';
TxtStrings:=TStringList.Create;
TxtStrings.LoadFromFile('C:/aaa.txt');
AssignFile(Fhtm, Fh);
Rewrite(Fhtm);
Writeln(Fhtm,FHead);
Writeln(Fhtm,'<title>'+'C:/aaa.txt'+'</title>');
Writeln(Fhtm,FBody);
for i:=0 to TxtStrings.Count-1 do
begin
Writeln(Fhtm,'<P Align="left">'+TxtStrings.Strings+'</P>')
end;
Writeln(Fhtm,FEnd);
CloseFile(Fhtm);
TxtStrings.Free;
end;