ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 11th, 2000, 07:15 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Hit Counter - Not Using Application Only - Need Help

<i><b>Originally posted by : merLin (driggins@lockbox.com)</b></i><br />For a recent project, I needed to create a hit counter, and it seemed simple enough, just throw an application variable and increment it by sessions. Only problem is that the host auto-reboots the server every 24 hours, so it erases the data every day.<br /><br />So to fix this I embarked on a journey to create a "real" asp hit counter.<br /><br />To do this I used the OpenTextStream method of the FileSystem object to create a text file, and read the file, then after I've read and set the number to my Application variable, I close the file, re-open it with ForWrite instead of ForRead, and do a WriteLine call with the new value that has incremented. This would store it in a text file so it would never get erased. And in theory it works great, but I'm not even getting past the most basic of problems, getting error:<br /><br />Server.CreateObject Failed...<br /><br />but the weird thing is right after that it says the operation completed successfully, but it didn't create a text file..?<br /><br />Does anyone know of an easier way or where someone else has already made some of this code?<br /><br /> Any Help is Appreciated...<br /><br />Thanks,<br />merLin

Reply With Quote
  #2  
Old May 12th, 2000, 09:29 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : steve</b></i><br /><br />http://aspfree.com/asp/startpage.asp?id=45<br /><br />here is a text file demo, just make sure the iusr account has write permissions.<br /><br />------------<br />merLin at 5/11/2000 5:15:12 AM<br /><br />For a recent project, I needed to create a hit counter, and it seemed simple enough, just throw an application variable and increment it by sessions. Only problem is that the host auto-reboots the server every 24 hours, so it erases the data every day.<br /><br />So to fix this I embarked on a journey to create a "real" asp hit counter.<br /><br />To do this I used the OpenTextStream method of the FileSystem object to create a text file, and read the file, then after I've read and set the number to my Application variable, I close the file, re-open it with ForWrite instead of ForRead, and do a WriteLine call with the new value that has incremented. This would store it in a text file so it would never get erased. And in theory it works great, but I'm not even getting past the most basic of problems, getting error:<br /><br />Server.CreateObject Failed...<br /><br />but the weird thing is right after that it says the operation completed successfully, but it didn't create a text file..?<br /><br />Does anyone know of an easier way or where someone else has already made some of this code?<br /><br /> Any Help is Appreciated...<br /><br />Thanks,<br />merLin

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Hit Counter - Not Using Application Only - Need Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT