zoukankan      html  css  js  c++  java
  • 【Vegas原创】网站计数器(asp)

    Global.asa 加入以下代码:

    <Script language="VBScript" runat="server">

        
    Sub Session_OnStart
            
    Dim strCon
            strCon
    ="Database=tmpCounter;uid=sa;pwd=****;driver={SQL Server};server=****"

            
    Dim server_name,url
            url
    =Request.ServerVariables("SCRIPT_NAME")
            urlArray
    =Split(url,"/")
            server_name
    =Request.ServerVariables("SERVER_NAME"& "/" & urlArray(1)
            Application.Lock

                
    If Application("counter")=null Then
                    
                    Application(
    "counter")=1

                
    Else

                    Application(
    "counter")=Application("counter")+1

                
    End If

            Application.Unlock
            
            
    Dim login_ip
            login_ip
    =Request.ServerVariables("REMOTE_ADDR")
            
    Dim insStr
            insStr
    ="insert tcounter(login_ip,server_name,counter) values('" & login_ip & "','" & server_name & "'," & Application("counter"& ")"
            
            
    Set db=server.CreateObject("ADODB.Connection")
            db.open strCon
            db.execute(insStr)
            db.close()
            
    Set db=Nothing
            
        
    End Sub
    </Script>
    喜欢请赞赏一下啦^_^
  • 相关阅读:
    19-1 在页面中渲染基本的组件
    19 使用Vue实例的render方法渲染组件
    17 webpack中babel的配置
    前端待复习汇总
    301,302,303,307重定向区别
    尾递归
    Binary-to-text ecoding:
    object Object {} any unknown
    Vue中的model
    全局namespace与模块内的namespace
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744662.html
Copyright © 2011-2022 走看看