<%@ Application Language="VB" %>
<script RunAt="server">
    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        '在应用程序启动时运行的代码
    End Sub

    Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        '在应用程序关闭时运行的代码
    End Sub

    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
        '在出现未处理的错误时运行的代码
    End Sub

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        '在新会话启动时运行的代码
    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        '在会话结束时运行的代码。
        ' 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
        '设置为 InProc 时，才会引发 Session_End 事件。如果会话模式
        '设置为 StateServer 或 SQLServer，则不会引发该事件。
    End Sub

    Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
        Dim q As String = "<div style='position: fixed; background-color: white; color: green; font-weight: bold; font-size: 14px; line-height: 25px;'>您所提交的内容含有非法字符！<br />详情请登录<a href='http://www.qianbo.com.cn/' target='_blank'>千博学校网站管理系统</a>官方网站获取支持。</div>"
        If Request.Cookies IsNot Nothing Then
            If Qianbo_Safe.CookieData() Then
                Response.Write(q)
                Response.End()
            End If
        End If
        If Request.UrlReferrer IsNot Nothing Then
            If Qianbo_Safe.referer() Then
                Response.Write(q)
                Response.End()
            End If
        End If
        If Request.RequestType.ToUpper() = "POST" Then
            If Qianbo_Safe.PostData() Then
                Response.Write(q)
                Response.End()
            End If
        End If
        If Request.RequestType.ToUpper() = "GET" Then
            If Qianbo_Safe.GetData() Then
                Response.Write(q)
                Response.End()
            End If
        End If
    End Sub
</script>