All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
PHP技巧:PHP如何禁止图片文件的被盗链_[PHP教程]
SQL,SERVER,DBCC命令解释_mssql学习_编程技术
ASP.NET Remoting概述与实例
VB.NET实现窗体图标最小化到状态栏_.net资料_编程技术
动态网页技术PHP入门基础:什么是PHP_php资料_编程技术
《Effective,C#》:区别四个判等函数_.net资料_编程技术
PHP实现文本文件直接调用实例_[PHP教程]
PHP技巧:php技术生成静态页面的实现_[PHP教程]
Ajax无刷新实现图片切换特效_.net资料_编程技术
PHP一些常用的正则表达式_[PHP教程]
Reading number is top 10 pictures
这才是真正的人体艺术1
a pure sister
性感丰满身材火爆de美女2
PengLiYuan lady for the world health organization fight TB and AIDS goodwill ambassador
30 beautiful school beauty6
Chinese paper-cut grilles art appreciation3
Soldier saw beauty after the reaction
在加油站厕所门口看到的告示
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first2
为什么别人说你是疯子
Download software ranking
美女写真1
The cock of the Grosvenor LTD handsome
DreamWeaver8
Unix video tutorial4
The hero
Tram sex maniac 2 (H) rar bag4
Sora aoi, the maid, students' uniforms
matrix3
matrix2
传奇私服架设教程
delv published in(发表于) 2014/1/16 9:31:07 Edit(编辑)
利用Cache限制页面频繁请求(最少要等N秒)_[Asp.Net教程]

利用Cache限制页面频繁请求(最少要等N秒)_[Asp.Net教程]

利用Cache限制页面频繁请求(最少要等N秒)_[Asp.Net教程]

string ip = WebUtil.GetIPString();
if (path.StartsWith("/article/download.aspx")) //在Application_BeginRequest 判断是否需要限制的页,如果是特定页面在Page_Load中不用判断了。
{
string key = "请求时间限制_" + ip;
if (Context.Cache[key] == null)
{
Context.Cache.Insert(key, 1, null,
Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 10));//10秒限制
}
else
{
Visitor visitor = Visitor.Current;
if (!visitor.HasPermission(Permissions.Sponser)) // 赞助用户不作限制
{


nextTitle = "你要查看的页面";
nextUrl = Request.RawUrl;
message = "对不起,你的点击或刷新页面太快,服务器无法完成请求。请点击或刷新页面之间的时间不要小于10秒。赞助用户无此限制。谢谢!";
Util.RedirectToInfoPage(InfoIcon.Stop, message, nextTitle, nextUrl);
return;

}
}
}


来源:阿良.NET







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.