📄 attachright.cs
字号:
using System;
using System.Web;
using System.Collections;
using System.Configuration;
namespace ENet.HttpModule
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class AttachRight:IHttpModule
{
public AttachRight()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public void Init(HttpApplication application)
{
try
{
application.BeginRequest += (new EventHandler(this.Application_BeginRequest));
}
catch
{}
}
private void Application_BeginRequest(Object source, EventArgs e)
{
try
{
HttpApplication application = (HttpApplication)source;
HttpContext context = application.Context;
System.Web.HttpApplicationState App=context.Application;
Hashtable hsData;
if(App["AttachRightHash"]==null)
{
hsData=CRules.getRules();
App["AttachRightHash"]=hsData;
}
else
{
hsData=(Hashtable)App["AttachRightHash"];
}
string UserID="";
string User_JgjgCode="";
string SessionID="";
try
{
System.Web.HttpCookie ck=context.Request.Cookies["E3Cookie"];
UserID=ck["Attach_E3_UserID"].ToString();
User_JgjgCode=ck["Attach_User_JgjgCode"].ToString();
SessionID=ck["Attach_SessionID"].ToString();
}
catch
{
}
string sMessage="";
int iResult=CRules.CheckAttachRight(SessionID,context.Request.FilePath,
UserID,User_JgjgCode,ref sMessage,hsData);
if(iResult==0)
{
context.Response.Clear();
context.Response.Write("权限限制,不允许访问。");
context.Response.End();
}
}
catch
{}
}
public void Dispose()
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -