我爱Aspx >> C#.Net >> 用ASP编写计数器<%
dim fso,f,no,I '定义变量绝对是个好习惯
Set fso = CreateObject("Scripting.FileSystemObject") '建立对象的实例
Set f = fso.OpenTextFile(Server.MapPath("count.no"), 1, True) '建立文本文件,打开为只读.
if f.AtEndOfStream then '判断这个文件是否不存在
no=1
else
no=f.ReadLine
no=no+1
end if
f.Close
set f=fso.OpenTextFile(Server.MapPath("count.no"),2,True) '准备写
f.Write(no) '写入
f.Close
'改进标志1
no=CStr(no) '整齐数字
for i=1 to 5-len(no)
no="0"&no
next
%>
<font color=white size=3pt>你是第<font color=red><%=no%></font>个来客</font>
上一篇: ASP防盗链及防下载的方法
下一篇: ASP进阶教程:给留言簿润下色
Ҷƪл˵?
ASP.NET中将数据输出到Excel[05-12]
Asp Object 之:PICS[05-12]
Asp Object 之:ExpiresAbsolute[05-12]
Asp Object 之:ServerVariables[05-12]
Asp Object 之:End[05-12]
ASP进阶教程:数据库版本的留言簿[05-12]
ASP进阶教程:给留言簿润下色[05-12]
Asp Object 之:Response[05-12]
Asp Object 之:Response.Cookies[05-12]
Asp Object 之:Request[05-12]
如何交换鼠标按键[05-12]
CGI的安全(二)[05-12]
JSP由浅入深(5-1)[05-12]
第十五节--Zend引擎的发展 -- Cl..[05-12]
使用PreparedStatement减少开发时..[05-12]
ASP.NET中将数据输出到Excel[05-12]
Asp Object 之:PICS[05-12]
Asp Object 之:ExpiresAbsolute[05-12]
Asp Object 之:ServerVariables[05-12]
Asp Object 之:End[05-12]