zoukankan      html  css  js  c++  java
  • asp实现统计访问量的代码

    <%
    dim count,path
    count= 1
    path = server.Mappath("count.txt")
    Set fs=CreateObject("scripting.filesystemobject")
    if(fs.FileExists(path))then
    Set hs=fs.opentextfile(path)
    count=hs.ReadLine
    if session("iscount")="" then
    session("iscount")="iscount"
    count=count+1
    end if
    hs.close
    Set hs=fs.opentextfile(path,2,true)
    hs.writeline(count)
    else
    Set hs=fs.createtextfile(path)
    hs.writeline(1)
    end if
    response.write "您是第"&count&"位访问者!"
    hs.close
    set fs=nothing
    %>

    <%
    dim count,path
    count= 1
    path = server.Mappath("count.txt")
    Set fs=CreateObject("scripting.filesystemobject")
    if(fs.FileExists(path))then
    	Set hs=fs.opentextfile(path)
    	count=hs.ReadLine
    	if session("iscount")="" then
    		session("iscount")="iscount"
    		count=count+1
    	end if
    	hs.close
    	Set hs=fs.opentextfile(path,2,true)
    	hs.writeline(count)
    else
    	Set hs=fs.createtextfile(path)
    	hs.writeline(1)
    end if
    response.write "您是第"&count&"位访问者!"
    hs.close
    set fs=nothing
    %>
    

     非每次刷新都记录!

  • 相关阅读:
    作用域链及作用域面试题
    this在js中的作用
    dom对象
    作用域问题
    逻辑运算
    socket.io 的使用
    mongoDB 的使用
    使用 usb 调试的时候,连接上电脑没反应
    uni-app 的更新及碰到的问题
    WebSocket 的使用
  • 原文地址:https://www.cnblogs.com/juexin/p/2735174.html
Copyright © 2011-2022 走看看