n.nsivakumar Posted November 23, 2005 Share Posted November 23, 2005 Hi guysIam Siva new to this forum and recently i faced a problem in PageCounter component, which is used to count the number of times the webpage has been opened. But when i shutdown the server at pagecounter value of 20 after restarting it will not continue from 21 instead it will start from 1.But i have read that it can store the values in some textfile and registered in the registry. But it cannot happen to me.Provide a technical support if u can.Siva. Link to comment Share on other sites More sharing options...
Jerome Posted November 23, 2005 Share Posted November 23, 2005 Hi Siva,You should create a .txt file called, for e.g., counter.txt and place it in the adequate root directory. In this file you only should write the number zero (0). Then use this code to increase the number contained in the file : ' Here you just open the conter.txt file and read the number... Set FS=Server.CreateObject("Scripting.FileSystemObject")Set RS=FS.OpenTextFile(Server.MapPath("counter.txt"), 1, False)fcount=RS.ReadLineRS.Close' You increase the number...fcount=fcount+1' You insert the new number in your conter.txt file ...Set RS=FS.OpenTextFile(Server.MapPath("counter.txt"), 2, False)RS.Write fcountRS.CloseSet RS=NothingSet FS=Nothing You can also use some cookies or a session object to prevent a user to increase your counter more than once on the same day.This helps? Link to comment Share on other sites More sharing options...
n.nsivakumar Posted November 26, 2005 Author Share Posted November 26, 2005 Hi JeromeThanks for ur reply. But iam asked about pagecounter component created using MSWC.PageCounter Syntax, used to determine number of hits the page receive. the count value will be stored in some central management file in registry, here only i dont know how to create. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now