|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Revised question |
From: |
Kevin |
Date: |
3/2/2000 10:44:07 AM |
IP: |
156.153.255.178 |
Ok so I found a sample on this web site of how to schedule an asp script to execute, so now I have just one question, about 2/3s the way down it says "Here you would put any code you need to run"
ok that makes sense, but for some reason Im not coming up with the right syntax. So what code would I put in there to run my script?
Your help would be greatly appreciated
Here is the sample I found, I found it at
http://www.powerasp.com/content/hintstips/schedule-global.asp
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
Application("SessionCount") = 0
End Sub
Sub Session_OnStart
Application.Lock
Application("SessionCount") = Application("SessionCount") + 1
Application.Unlock
If Application("SessionCount") > 15 Then
Application.Lock
Application("SessionCount") = 0
Application.Unlock
Set ObjMyFile = CreateObject("Scripting.FileSystemObject")
Set OpenMyFile = ObjMyFile.OpenTextFile(Server.MapPath("last-update.txt"))
MyFileValue = OpenMyFile.ReadLine
OpenMyFile.Close
If DateDiff("h",MyFileValue,NOW) > 6 Then
Here you would put any code you need to run
do not surround the code with <% %> tags
For example you might run a database query that checks for expired accounts
Set WriteMyFile = ObjMyFile.CreateTextFile(Server.MapPath("last-update.txt"))
WriteMyFile.WriteLine(NOW)
WriteMyFile.Close
End if
End If
End Sub
</SCRIPT>
|
Follow Up - Re: Revised question - Chris Mangano 3/13/2000 7:07:24 PM
|
|

|
|
|
|
|
|
|
|
|
|