更改网页中的数据的问题 [Error] Unit1.pas(55): Statement expected but 'PROCEDURE' found [Fatal Error] Project2.dpr(9): Could not compil

subobo 2008-03-31 09:51:19
//这个是代码

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.
...全文
154 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
有问题请先GOOGLE,BAIDU
回复
meiZiNick 2008-04-30
接分是王道!
回复
相关推荐
发帖
网络通信/分布式开发
创建于2007-08-02

1573

社区成员

Delphi 网络通信/分布式开发
申请成为版主
帖子事件
创建了帖子
2008-03-31 09:51
社区公告
暂无公告