ASP计数器

发布时间:2013-09-19 11:33:46来源:阅读(1853)

    ************************调用*********************
    '*
    '*************************************************

    javastr="
    "
    <%
    max=Request("max") '//计数器位数
    If Request.cookies("count")="" Then '//防刷
    Set fso=Server.CreateObject("Scripting.FileSystemObject")
     Set fp=fso.OpenTextFile(Server.MapPath("count.dat")) '//计数器统计文件
     countn=fp.Readline
     countn=countn+1
     Fp.close
     Set fp=Nothing
     set fp=fso.createtextfile(server.mappath("count.dat"))
     fp.Writeline countn
     set fp=nothing
     set fso=nothing
     Response.Cookies("count")=countn
    End If
    Set fso=Server.CreateObject("Scripting.FileSystemObject")
    Set fp=fso.OpenTextFile(Server.MapPath("count.dat"))
    s=fp.Readline
    For n=(max-len(s)) to 1 step -1
    %>
    javastr=javastr+"" '//计数器图片文件
    <%
    Next
    j=0
    For i=(max-len(s)) to max-1
     j=j+1
    %>
    javastr=javastr+""
    <%
    Next
    Set fp=Nothing
    Set fso=Nothing
    javastr=javastr+"
    "
    %>
    document.write(javastr)

关键字