Asp+txt Create a simple counter

Source: Internet
Author: User

The documents are as follows:
<%
Dim Vis
Set Js=createobject ("Scripting.FileSystemObject")
Set F=js.createtextfile ("D:/count.txt", True)
F.writeline 0
F.close
Whichfile=js.getfile ("D:/count.txt")
Set Thisfile=js.opentextfile (Whichfile)
Vis=thisfile.readline
Thisfile.close
Vis=vis+1
Response.Write Vis
Set Out=js.createtextfile (Whichfile)
Out.writeline Vis
Out.close
%>
The test shows only 1, not a refresh of 2, by analogy.
If the file created above is D:/count.txt, this part is removed and the file is as follows:
<%
Dim Vis
Set Js=createobject ("Scripting.FileSystemObject")
Whichfile=js.getfile ("D:/count.txt")
Set Thisfile=js.opentextfile (Whichfile)
Vis=thisfile.readline
Thisfile.close
Vis=vis+1
Response.Write Vis
Set Out=js.createtextfile (Whichfile)
Out.writeline Vis
Out.close
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.