username@email.com
2025-03-05 9eaaeff84fedc8424ee9c7ea31bfd60cc1e8ff4e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
 
namespace CY.Application
{
    /// <summary>
    /// 应用程序级请求处理类
    /// </summary>
    public class CYHttpModule : IHttpModule
    {
        #region IHttpModule 成员
 
        public void Dispose()
        {
            throw new NotImplementedException();
        }
        
        /// <summary>
        /// 连接初始化处理
        /// </summary>
        /// <param name="context"></param>
        public void Init(HttpApplication context)
        {
            context.BeginRequest += new EventHandler(this.ReUrl_BeginRequest);
            context.EndRequest += new EventHandler(this.ReUrl_EndRequest);
        }
 
        /// <summary>
        /// 开始请求处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReUrl_BeginRequest(object sender, EventArgs e)
        {
 
        }
 
        /// <summary>
        /// 结束请求处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReUrl_EndRequest(object sender, EventArgs e)
        {
 
        }
 
        #endregion
 
        /// <summary>
        /// 应用程序级错误处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Application_OnError(object sender, EventArgs e)
        {
            //HttpApplication application = (HttpApplication)sender;
            //HttpContext context = application.Context;
            //context.Response.Write("<html><body style=\"font-size:14px;\">");
            //context.Response.Write("系统错误:<br />");
            //context.Response.Write("<textarea name=\"errormessage\" style=\"width:80%; height:200px; word-break:break-all\">");
            //context.Response.Write(HttpUtility.HtmlEncode(context.Server.GetLastError().ToString()));
            //context.Response.Write("</textarea>");
            //context.Response.Write("</body></html>");
            //context.Response.End();
        }
    }
}