Can you use JAVASCRIPT to help me write a counter? I want to use the ones that need to bring text in ASP? Please......
I wrote one myself, without text. Can anyone help me make up for it?
<%@Language=Jscript%>
<%
Application.Lock();
Application("Counter")=parseInt(Application("Counter"))+1;
Application.UnLock();
%>
I know I need to use <%
varpath=Server.MapPath("test.txt");
varMyFileObject=Server.CreateObject("Scripting.FileSystemObject");
varMyTextFile=MyFileObject.CreateTextFile(path);
MyTextFile.WriteLine("");
MyTextFile.Close();
%>How do you write these commands specifically?
The code copy is as follows:
Let me give you the most complete one:
<scriptlanguage="vbscript"runat="server">
Subapplication_onstart
'The real path to the count file
countfile=server.mappath("count.txt")
'Create a file system object instance
setmyfso=server.createobject("scripting.filesystemobject")
'If the count file does not exist
ifnotmyfso.fileexists(countfile)then
'Create this file and get the textstream object instance
setmytextstream=myfso.createtextfile(countfile,True)
application.lock
application("online")=0
application("counter")=0
application.unlock