Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


working intranet hit counter

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3439
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> working intranet hit counter
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 working intranet hit counter - 6/18/2005 1:16:18 AM   
  gibbo1715

 

Posts: 52
Score: 0
Joined: 6/8/2005
From:
Status: offline
All,

I needed a hit counter for my works intranet, came up with the following and thought i d share it with you all, if anyone can think of a way to improve it then feel free but can I ask you share the code here for everyones benefit

Hope this is of use to someone

Cheers

Gibbo

<SCRIPT type=text/vbscript>

Dim fso
Dim tso
Dim filObject
Dim VisitorCount
Dim strOutputName
Dim objOutputFile

Set fso = CreateObject("Scripting.FileSystemObject")
Set filObject = fso.GetFile("C:\hit.txt")
Set tso = filObject.OpenAsTextStream

VisitorCount = CLng(tso.ReadAll)
VisitorCount = VisitorCount + 1

strOutputName = "C:\hit.txt"

Set objOutputFile = fso.createTextFile(strOutputName,True)

objOutputFile.WriteLine VisitorCount

Document.Write(VisitorCount)

</Script>
 
 
Post #: 1
 
 RE: working intranet hit counter - 6/25/2008 11:16:21 PM   
  1977Nicky

 

Posts: 2
Score: 0
Joined: 6/25/2008
Status: offline
Hi there,

I used your script (thank you) on my intranet site after hunting for ages for a hit counter code that didn't require linking to the internet. Your code works, however it only works when I look at the intranet pages and not any of my 300 users which isn't very useful! Have you any idea why this might be? THANK YOU!

Nicky

(in reply to gibbo1715)
 
 
Post #: 2
 
 RE: working intranet hit counter - 6/26/2008 4:31:37 AM   
  Rischip


Posts: 477
Score: 2
Joined: 3/26/2007
Status: offline
You will need to run the script server side, or put the file on a share that has write access for groups everyone or Authenticated Users

_____________________________

Rischip
Author of - The Grim Linker

(in reply to 1977Nicky)
 
 
Post #: 3
 
 RE: working intranet hit counter - 6/26/2008 7:22:50 AM   
  1977Nicky

 

Posts: 2
Score: 0
Joined: 6/25/2008
Status: offline
Thank you so much, I did realise earlier today I hadn't set the permissions and sure it enough it works now, it's always the simple things!! :-)

(in reply to Rischip)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> working intranet hit counter Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts