惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
Project Zero
Project Zero
L
LINUX DO - 最新话题
C
Cisco Blogs
P
Privacy International News Feed
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
Webroot Blog
Webroot Blog
K
Kaspersky official blog
Help Net Security
Help Net Security
博客园_首页
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
雷峰网
雷峰网
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
A
Arctic Wolf
I
Intezer
V
V2EX
博客园 - 【当耐特】
Latest news
Latest news
T
Tenable Blog
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
Cyberwarzone
Cyberwarzone
量子位
G
GRAHAM CLULEY
T
Troy Hunt's Blog
博客园 - Franky
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 三生石上(FineUI控件)
TaoSecurity Blog
TaoSecurity Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Jina AI
Jina AI
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Scott Helme
Scott Helme

博客园 - 登峰

VS2010 工具箱装载出错 将用户导入到membership 网络和笔记本 用live writer写博客 上海招聘.net程序员 Virtual Machine--Vmware(2) Virtual Machine -- VmWare(1) 代码自动生成操作 - 登峰 - 博客园 病毒惹的祸 一道受用终身的测试题 慎用优化工具 一个简单的存储过程代码生成器 DataGrid的Bug? 哪个是最好的ORM C#设计模式---概述篇 还原master数据库 Sql Server实用操作小技巧集合(转载) .net 程序发生了一个不可捕获的异常 n取的r的组合数问题
javascript写计数器 - 登峰 - 博客园
登峰 · 2007-05-09 · via 博客园 - 登峰

<script   language   =   "vbscript"   runat   =   "server">   
  sub   application_onstart   
          '取的计数文件的真实路径   
          countfile=server.mappath("count.txt")   
          '创建文件系统对象实例   
          set   myfso   =   server.createobject("scripting.filesystemobject")   
          '若计数文件不存在   
  if   not   myfso.fileexists(countfile)   then   
                  '创建该文件及取得textstream对象实例   
  set   mytextstream   =   myfso.createtextfile(countfile,   True)   
  application.lock   
  application("online")   =   0   
  application("counter")   =   0   
  application.unlock   
  '将计数值写入文件     
  mytextstream.writeline(cstr(application("counter")))   
  else   
                  '以只读的方式打开   
                  set   mytextstream   =   myfso.opentextfile(countfile,1,false)   
                  '读一行,并将值赋给计数变量   
                  application("counter")   =   mytextstream.readline   
  end   if   
        mytextstream.close   
        set   myfso   =   nothing   
  end   sub   
  sub   session_onstart   
          session.timeout   =   1   
          countfile   =   server.mappath("count.txt")   
          set   myfso   =   server.createobject("scripting.filesystemobject")   
          application.lock   
          application("online")   =   application("online")+1   
          application("counter")   =   application("counter")+1   
          application.unlock   
          '以写方式打开文件   
          set   mytextstream   =   myfso.opentextfile(countfile,2,false)   
          '以写行的方式将数据写入文件   
          mytextstream.writeline(cstr(application("counter")))   
          mytextstream.close   
          set   myfso   =   nothing   
  end   sub   
  sub   session_onend   
          application.lock   
          application("online")   =   application("online")-1   
          application.unlock   
  end   sub   
  </script>                                 
  <html>   
  <head>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>计数器例子</title>   
  </head>   
  <body>   
  <div   align="center">您是本站第<font   color="#FF0000"><%=application("counter")%></font>位贵宾!     
  </div>   
  </body>   
  </html>