【delphi开源代码栏目提醒】:网学会员鉴于大家对delphi开源代码十分关注,论文会员在此为大家搜集整理了“ErrorPas.pas”一文,供大家参考学习
unit ErrorPas;
interface
uses
Windows, Messages, SysUtils, Classes, HTTPApp, WebModu, HTTPProd;
type
TErrorPage = class(TWebPageModule)
PageProducer: TPageProducer;
procedure PageProducerHTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings;
var ReplaceText: String);
private
{ Private declarations }
public
{ Public declarations }
end;
function ErrorPage: TErrorPage;
implementation
{$R *.dfm} {*.html}
uses WebReq, WebCntxt, WebFact, Variants;
function ErrorPage: TErrorPage;
begin
Result := TErrorPage(WebContext.FindModuleClass(TErrorPage));
end;
procedure TErrorPage.PageProducer
HTMLTag(Sender: TObject; Tag: TTag;
const TagString: String; TagParams: TStrings; var ReplaceText: String);
begin
if TagString='ErrorInfo' then
ReplaceText:='尊敬的用户'
end;
initialization
if WebRequestHandler <> nil then
WebRequestHandler.AddWebModuleFactory(TWebPageModuleFactory.Create(TErrorPage, TWebPageInfo.Create([wpPublished {, wpLoginRequired}], '.html', '', '错误信息'), crOnDemand, caCache));
end.