最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp防刷新函数
时间:2022-07-02 23:16:19 编辑:袖梨 来源:一聚教程网
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
相关文章
- 光遇12.23每日任务怎么做 光遇12月23日每日任务做法攻略 12-23
- 光遇12.23大蜡烛在哪里 光遇12月23日大蜡烛位置攻略 12-23
- 光遇12.23免费魔法有什么 光遇12月23日免费魔法收集攻略 12-23
- 《流放之路2》寻找熔炉任务攻略分享 12-23
- 《流放之路2》德雷文打法技巧分享 12-23
- 《流放之路2》永恒裁判者德雷文具体位置介绍 12-23