<%
dim FS,FStream
dim Phypath
dim OpenTextFile,CreateTextFile
dim VisitNum
Phypath=Server.MapPath(".\")&"\count.txt"
Set FS=Server.CreateObject("Scripting.FileSystemObject")
Set FStream=FS.OpenTextFile(Phypath,1,false,-2)
VisitNum=FStream.ReadLine
FStream.close
'=====================================文件读取完毕,取得上次访问量VisitNum
Set FStream=FS.CreateTextFile(Phypath,true,false)
Application.Lock
Application("VisitNum")=VisitNum+1
FStream.WriteLine(VisitNum)
Application.UnLock
FStream.close
'=====================================计数器操作完毕,返回新的VisitNum
response.Write "
您是本站第"_
&"" & Application("VisitNum") & "位访客
"
%>
'=========================================
以上过程在测试中,始终提示“没有创建文本及写入数据的权限”
错误码如下:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft VBScript 运行时错误 错误 '800a0046'
没有权限
/cs/count.asp,行24
==============================================
本人在IIS中设置了该文件所在虚拟目录的权限有读取和写入的权限,
但该站点中的文件只能读取数据还是不能写入数据,请高手指点该怎么玩!