页面导航: 首页网络编程ASP编程应用技巧 → 正文内容

asp防止刷新功能

发布:dxy 发布日期:2006-8-22 字体:[增加 减小] 类型:转载
asp防止刷新

Sub chkreflash()
    dim ScriptName
    ScriptName=lcase(request.ServerVariables("PATH_INFO"))
    dim posttime,DoReflashPage,ReflashPage,SplitReflashPage
    posttime=1 '防止刷新时间
    DoReflashPage=false
    ReflashPage="|Article_one.asp"
    SplitReflashPage=split(ReflashPage,"|")
        for i=0 to ubound(SplitReflashPage)
             if instr(scriptname,SplitReflashPage(i))>0 then
                DoReflashPage=true
            exit for
             end if
        next
    if (not isnull(session("ReflashTime"))) and posttime>0 and DoReflashPage then
        if DateDiff("s",session("ReflashTime"),Now())<posttime then
            call msg("警告!系统已记录您的IP,和刷新次数。\n\n请不要在"&posttime&"秒内连续刷新本页面!","-1")
        else
        session("ReflashTime")=Now()
        end if
    elseif isnull(session("ReflashTime")) and posttime>0 and DoReflashPage then
        Session("ReflashTime")=Now()
    end if
End Sub

调用方法在页面首部加入chkreflash即可
百度中搜索更多的关于asp防止刷新功能内容,或者用Google搜索相关更多
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行