marwood systems ltd
  please click for information >
   
  consultancy services
  IT training
  IT support
  customised software
  about us
  contact us
   

 

CodeAve.com(Daily Hit Counter) <% on error resume next ' Create a server object set fso = createobject("scripting.filesystemobject") ' Target the text file to be read. ' The text file is continually updated with the current date from the server ‘set act = fso.opentextfile(server.mappat... month(date()) & day(date()) & year(date())&".txt")) Set act = fso.CreateTextFile(server.mappath("counter.txt"), true) ' Read the value contained in the current day hit counter ' If there is no file for the current day the on error resume next command above ' will force the program to the next line counter = clng(act.readline) ' Add one to the counter. If there was no value the counter will be set to a value of one counter = counter + 1 ' Close the text object. act.close ' Create a new text file on the server with the current date as part of the name Set act = fso.createtextfile(server.mapp... month(date()) & day(date()) & year(date())&".txt"), true) ' Write the counter value to the text object act.writeline(counter) ' Close the text object act.Close 'Write out the date and total hits for the current day %> <%= counter %>