3个回答
展开全部
下面是一个用文本文件的实例:
<%
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Dir = Request.ServerVariables("SCRIPT_NAME")
Dir = StrReverse(Dir)
Dir = Mid(Dir, InStr(1, Dir, "/"))
Dir = StrReverse(Dir)
HitsFile = Server.MapPath(Dir) & "\hits.TXT"
On Error Resume Next
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
if session("connected")="" then
OldHits = OldHits + 1
else
OldHits=OldHits
end if
NewHits=OldHits
session("connected")=true
Set OutStream= FileObject.CreateTextFile (HitsFile, True,false)
OutStream.WriteLine(OldHits)
%>
OldHits就是累加结果
<%
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Dir = Request.ServerVariables("SCRIPT_NAME")
Dir = StrReverse(Dir)
Dir = Mid(Dir, InStr(1, Dir, "/"))
Dir = StrReverse(Dir)
HitsFile = Server.MapPath(Dir) & "\hits.TXT"
On Error Resume Next
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
if session("connected")="" then
OldHits = OldHits + 1
else
OldHits=OldHits
end if
NewHits=OldHits
session("connected")=true
Set OutStream= FileObject.CreateTextFile (HitsFile, True,false)
OutStream.WriteLine(OldHits)
%>
OldHits就是累加结果
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一般使用文本文件+FSO
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询