更改网页中的数据的问题 [Error] Unit1.pas(55): Statement expected but 'PROCEDURE' found [Fatal Error] Project2.dpr(9): Could not compil
//这个是代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Graphics, Controls, Forms,
Dialogs, StdCtrls, Classes, HTTPApp, HTTPProd;
type
TWebModule1 = class(TWebModule)
PageProducer1: TPageProducer;
procedure WebModuleCreate(Sender: TObject);
procedure PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings;
var ReplaceText: String);
procedure WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
WebModule1: TWebModule1;
filepath:string;
implementation
{$R *.dfm}
//initialization //不加这个不能产生creat事件
procedure TWebModule1.WebModuleCreate(Sender: TObject);
var
path:array[0..200] of char;
pathstr:string;
begin
setstring(pathstr,path,GetModuleFileName(hinstance,path,sizeof(path)));
filepath:=extractfilepath(pathstr);
end;
procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
case tag of
tgcustom:if tagstring='name' then replacetext:='各位朋友';
end;
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
pageproducer1.HTMLFile:=filepath+'mypage.htm';
response.Content:=pageproducer1.Content;
end;
end.