Web Analytics Made Easy -
StatCounter Could this be done in JAVA? - CodingForum


No announcement yet.

Could this be done in JAVA?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Could this be done in JAVA?

    I have an event creator written in ASP which saves the current event as a HTML file...

    What needs to be done is to check the current events file to see if its older than 3 hours, if its is then it'll show no events or no_events.html, else show the current event etc.

    Last edited by Barabbas; Jul 7, 2002, 05:33 AM.

  • #2
    Why would you want to do it in JS when it can be easily accomplished server side in ASP, that you are using
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


    • #3
      You know when you get to that stage when you just can't get your head around a peice of code and start pulling your hair out to look for alternatives...

      Well i've sorted it now, thanks for the reply, after the 60th view!!!!!!! lol

      Heres what i came up with:


      Dim MyFileObject, MyFile, MyFileTrue, TimeOut, RealTime
      Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
      set MyFile=MyFileObject.GetFile(Server.MapPath("current_event.htm"))

      RealTime = hour(now)
      TimeOut = hour(MyFile.DateLastModified) + 3 ' Put timeout at 3 ours ahead of the creation date

      If RealTime < TimeOut AND day(now) = day(MyFile.DateLastModified)Then
      <!--#include file="current_event.htm"-->
      <!--#include file="none.htm"-->
      end if
      Set MyFileObject = nothing
      Set MyFile = nothing
      set RealTime = nothing
      set TimeOut = nothing