url=request("url") Set fs = CreateObject("Scripting.FileSystemObject") if fs.FileExists(path & file & ".txt") then Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False) number=thisfile.readline + 1 thisfile.Close Set outfile=fs.CreateTextFile(path & file & ".txt") outfile.WriteLine number outfile.close set fs=nothing else number=1 Set outfile=fs.CreateTextFile(path & file & ".txt") outfile.WriteLine number outfile.close set fs=nothing end if
response.redirect url
%>
view.asp *************************** <% path="d:data" file=request("save") Set fs = CreateObject("Scripting.FileSystemObject") if fs.FileExists(path & file & ".txt") then Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False) number=thisfile.readline thisfile.Close set fs=nothing else number=0
end if response.contenttype = "application/x-javascript" response.write "document.write(""" & number & """);"
url=request("url") Set fs = CreateObject("Scripting.FileSystemObject") if fs.FileExists(path & file & ".txt") then Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False) number=thisfile.readline + 1 thisfile.Close Set outfile=fs.CreateTextFile(path & file & ".txt") outfile.WriteLine number outfile.close set fs=nothing else number=1 Set outfile=fs.CreateTextFile(path & file & ".txt") outfile.WriteLine number outfile.close set fs=nothing end if
response.redirect url
%> view.asp里的代码是 <% path=server.MapPath("my_") file=request("save") Set fs = CreateObject("Scripting.FileSystemObject") if fs.FileExists(path & file & ".txt") then Set thisfile = fs.OpenTextFile(path & file & ".txt", 1, False) number=thisfile.readline thisfile.Close set fs=nothing else number=0
end if response.contenttype = "application/x-javascript" response.write "document.write(""" & number & """);" %> 还有就是有人说里面的application.lock没有用??~~ 不知道他说的对不对???~~~~ 我想应该有用吧,这是和计数器的原理一样的,如果有两个人同时点了链接,而没用application.lock的话那么计数器就只会计一次,是这样的吧,所以应该还是有用的
----------------------------------------------
-