delphi.net开发学习笔记(1),状态变量处理(Global.asax)
来源:互联网 发布:asp时时彩源码 编辑:程序博客网 时间:2024/05/21 22:56
对于Application和SSession状态以及变量的处理可以在这个文件中处理,工程建立时没有这个文件可以从other里面添加;VS2005里面还有对于页面状态变量的处理,这里好像没有,不知道怎么搞,以后研究着看吧。
procedure Application_BeginRequest(sender: System.Object; e: EventArgs);
procedure Application_EndRequest(sender: System.Object; e: EventArgs);
这两个东东看上去很好玩啊!
unit Global;interfaceuses System.Collections, System.ComponentModel, System.Web, System.Web.SessionState;type TGlobal = class(System.Web.HttpApplication) {$REGION ‘Designer Managed Code‘} strict private procedure InitializeComponent; {$ENDREGION} strict protected procedure Application_Start(sender: System.Object; e: EventArgs); procedure Session_Start(sender: System.Object; e: EventArgs); procedure Application_BeginRequest(sender: System.Object; e: EventArgs); procedure Application_EndRequest(sender: System.Object; e: EventArgs); procedure Application_AuthenticateRequest(sender: System.Object; e: EventArgs); procedure Application_Error(sender: System.Object; e: EventArgs); procedure Session_End(sender: System.Object; e: EventArgs); procedure Application_End(sender: System.Object; e: EventArgs); private { Private Declarations } public constructor Create; end;implementation{$REGION ‘Designer Managed Code‘}////// Required method for Designer support -- do not modify/// the contents of this method with the code editor./// procedure TGlobal.InitializeComponent;beginend;{$ENDREGION}constructor TGlobal.Create;begin inherited; // // Required for Designer support // InitializeComponent; // // TODO: Add any constructor code after InitializeComponent call //end;procedure TGlobal.Application_Start(sender: System.Object; e: EventArgs);beginend;procedure TGlobal.Session_Start(sender: System.Object; e: EventArgs);begin Application.Lock; try if Application[‘NumUsers‘] = nil then Application[‘NumUsers‘] := System.Object(Integer(1)) else Application[‘NumUsers‘] := System.Object(Integer(Application[‘NumUsers‘])+1); finally Application.UnLock; end;end;procedure TGlobal.Application_BeginRequest(sender: System.Object; e: EventArgs);beginend;procedure TGlobal.Application_EndRequest(sender: System.Object; e: EventArgs);beginend;procedure TGlobal.Application_AuthenticateRequest(sender: System.Object; e: EventArgs);beginend;procedure TGlobal.Application_Error(sender: System.Object; e: EventArgs);beginend;procedure TGlobal.Session_End(sender: System.Object; e: EventArgs);begin Application.Lock; try if Application[‘NumUsers‘] <> nil then Application[‘NumUsers‘] := System.Object(Integer(Application[‘NumUsers‘])-1) else Application[‘NumUsers‘] := System.Object(Integer(0)); finally Application.UnLock; end;end;procedure TGlobal.Application_End(sender: System.Object; e: EventArgs);beginend;end.
- delphi.net开发学习笔记(1),状态变量处理(Global.asax)
- Global.asax文件—ASP.NET细枝末节(1)
- net错误日志统一处理 Global.asax
- Asp.net Global.asax
- .net Global.asax
- delphi.net开发学习笔记(2),Application、Session、ViewState、Cookies状态以及变量处理
- ASP.NET使用Global.asax进行全局错误处理
- GLOBAL.ASAX .NET开发必须要了解的一个文件
- net 使用 Global.asax 文件
- ASP.NET中的Global.asax
- ASP.NET Global.asax详解
- ASP.NET的global.asax文件中的Application事件(一)
- ASP.NET的global.asax文件中的Application事件(二)
- No 114 · Asp.net中Global.asax文件的使用(监听)
- 学习MVC(1) MVC中的global.asax理解
- ASP.NET Global.asax 文件使用方法 - .net
- Asp.net中global.asax中可以处理的所有事件
- ASP.NET MVC中注册Global.asax的Application_Error事件处理全局异常
- 什么是Web 2.0
- 图形化基因分析结果
- 关于.NET组件使用的相关资料链接,更新中...
- owc11编程的小细节备忘
- 用JAVA写一个压缩文件的例子
- delphi.net开发学习笔记(1),状态变量处理(Global.asax)
- 解决"访问IIS元数据库失败"
- 别人的SERVERLET笔记
- 如何对webbrowser和IE编程(二)
- 如何对webbrowser和IE编程(三)
- delphi.net开发学习笔记(2),Application、Session、ViewState、Cookies状态以及变量处理
- SQL 收藏------------SQL操作全集
- 如何对webbrowser和IE编程(四)
- 另辟蹊径cmd