📄 global.asax.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace BlockIP
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
//http://www.svnhost.cn
//QQ:4111852
//系统启动时调用
//从数据库或者文件取出屏蔽掉的IP放入Application
//edit by 51aspx.com
Hashtable hash = new Hashtable();
hash.Add("127.0.0.1", string.Empty);//用127.0.0.1来测试
hash.Add("32.44.54.77", string.Empty);
hash.Add("132.44.54.77", string.Empty);
hash.Add("31.44.54.77", string.Empty);
hash.Add("21.44.54.77", string.Empty);
//加入了4个IP
Application["blockip"] = hash;
}
protected void Application_End(object sender, EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -