asp防刷新函数
Sub PreventRefresh()
Dim RefreshTime,isRefresh
RefreshTime = 10 '防止刷新时间,单位(秒)
isRefresh = 1 '是否使用防刷新功能,0=否,1=是
If isRefresh = 1 Then
If (Not IsEmpty(Session("RefreshTime"))) And RefreshTime > 0 Then
If DateDiff("s", Session("RefreshTime"), Now()) < RefreshTime Then
Response.Write "
本页面起用了防刷新机制,请不要在"&RefreshTime&"秒内连续刷新本页面
正在打开页面,请稍后……"
Response.End
Else
Session("RefreshTime") = Now()
End If
Else
Session("RefreshTime") = Now()
End If
End If
End Sub
Public Sub GetUserTodayInfo()
Dim Lastlogin,UserDayInfo
Lastlogin = Request.Cookies("newasp_net")("LastTime")
UserDayInfo = Request.Cookies("newasp_net")("UserToday")
If Not IsDate(LastLogin) Then LastLogin = Now()
On Error Resume Next
If DateDiff("d",LastLogin,Now())<>0 Then
Newasp.Execute("UPDATE [NC_User] SET UserToday='0,0,0,0,0,0',LastTime=" & NowString & " WHERE username='"& Newasp.membername &"' And userid=" & Newasp.memberid)
UserDayInfo = "0,0,0,0,0,0"
Response.Cookies("newasp_net")("UserToday") = UserDayInfo
Response.Cookies("newasp_net")("LastTime") = Now()
End If
UserToday = Split(UserDayInfo, ",")
If Ubound(UserToday) <> 5 Then
Newasp.Execute("UPDATE [NC_User] SET UserToday='0,0,0,0,0,0',LastTime=" & NowString & " WHERE username='"& Newasp.membername &"' And userid=" & Newasp.memberid)
UserDayInfo = "0,0,0,0,0,0"
Response.Cookies("newasp_net")("UserToday") = UserDayInfo
Response.Cookies("newasp_net")("LastTime") = Now()
UserToday = Split(UserDayInfo, ",")
End If
End Sub
Public Function UpdateUserToday(ByVal str)
On Error Resume Next
If Trim(str) <> "" Then
Newasp.Execute("UPDATE [NC_User] SET UserToday='" & str & "' WHERE username='"& Newasp.membername &"' And userid=" & Newasp.memberid)
Response.Cookies("newasp_net")("UserToday") = str
End If
End Function
迷雾城堡免广告 最新版v0.1.30
迷雾城堡免广告是一款非常好玩的模拟建造类手游,玩家无需看广告
鉴车大师免广告 安卓版v1.2.2
鉴车大师免广告是一款非常好玩的模拟类手游,玩家在游戏中不用看
从前有条街 安卓最新版v1.5
从前有条街是一款非常好玩的模拟经营类手游,玩家在游戏中将会进
我的世界源之界冰火魔龙 最新版v阿夜整合
我的世界源之界冰火魔龙模组整合包是一款像素风格的沙河模拟生存
假面骑士创骑腰带模拟器 安卓版v6
假面骑士创骑腰带模拟器是一个专为喜欢假面骑士的用户打造的变身