<SCRIPT LANGUAGE=VBSCRIPT RUNAT=SERVER>
Sub Application_OnStart
VisitorCountFilename = Server.MapPath("/cgi-bin/visitors.txt")
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out= FileObject.OpenTextFile (VisitorCountFilename, 1, False, False)
Application("visitors") = Out.ReadLine
Application("VisitorCountFilename") = VisitorCountFilename
End Sub
Sub Application_OnEnd
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out= FileObject.CreateTextFile (Application("VisitorCountFilename"), True, False)
Out.WriteLine(Application("visitors"))
Out.Close
End Sub
Application.Lock
Application("visitors") = Application("visitors") + 1
t_visitors = Application("visitors")
Application.Unlock
Session("VisitorID") = t_visitors
If t_visitors MOD 15 = 0 Then
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set Out= FileObject.CreateTextFile (Application("VisitorCountFilename"), True, False)
Application.Lock
Out.WriteLine(t_visitors)
Application.Unlock
End If
End Sub
Sub Session_OnEnd
Session("PageTheme") = Nothing
Session("PageTitle") = Nothing
End Sub
</SCRIPT>
<script language="VBScript" runat="Server">
Sub Application_OnStart
Application("OnlineNow") = 0
Application("Msg") = "Welcome to ThaiCreate.Com"
End Sub
Sub Session_OnStart
Application.Lock
Application("OnlineNow") = Application("OnlineNow")+1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("OnlineNow") = Application("OnlineNow")-1
Application.UnLock
End Sub
</script>