帮我看看一个网站流量ASP代码哪问题了,运行后提示语法错误!

来源:百度知道 编辑:UC知道 时间:2024/05/13 05:03:49
<%

dim path,myFile,read,write,cntNum
path=server.mappath("counter.cnt")
read=1
write=2
Set myFso = Server.CreateObject("Scripting.FileSystemObject")
set myFile = myFso.opentextfile(path,read)
cntNum=myFile.ReadLine
myFile.close
cntNum=cntNum+1
set myFile = myFso.opentextfile(path,write,TRUE)
myFile.write(cntNum)
myFile.close
set myFile=nothing
set myFso=nothing
%>
document.write('本页也被点击 <%=cntNum%>');

需不需要这么复杂啊?

其实统计网站人书用APPLICATION这个ASP的内置组件就可以了。你去看看APPLICATION的属性吧。统计直接用这个就行了 代码简单得多 一行就行了。

不要使用write做为变量
把write换一下就可以了!