|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Introduction To The GLOBAL.ASA For ASP Programmers
Introduction To The GLOBAL.ASA For ASP Programmers
Jul 16, 2003 - I spent quite a bit of time as an ASP programmer before I learned about the GLOBAL.ASA file. Like many others, I learned ASP the old fashioned way. Already familiar with Visual Basic, the leap to VBScript was not difficult. Then I took a look at some sample ASP code, starting doodling with it, and next thing you know, I’m an ASP programmer. Discuss this article in this thread. You can read the article here . |
|
#2
|
|||
|
|||
|
Article
Hi,
My name is Rich Smith, and I am the author of this article. I would be happy to answer any questions via this forum or email. Thanks for reading it. Rich |
|
#3
|
|||
|
|||
|
Pretty good and informative article Rich...
![]() |
|
#4
|
|||
|
|||
|
Hi.
I'm wondering how to "merge" two global.asa files into one. I have the sourcecode for both global.asa's but need to combine them into one, and don't know how. Can you tell me? Below are both global.asa's. The first one i for an asp-chatroom, the second is for an "online users" count. Global.asa #1 - ASP Chat: <script language="Vbscript" runat="server"> Sub Application_onStart Application("OnLine") = 0 End Sub Sub session_onStart session.timeout=15 Application("OnLine") = Application("OnLine")+1 End sub Sub session_onEnd Application("OnLine") = Application("OnLine")-1 If session("name") <> "" then APPLICATION.LOCK Application("spjallarar") = Replace(application("spjallarar"), session("name") & "§", "") Application("txt20") = Application("txt19") Application("txt19") = Application("txt18") Application("txt18") = Application("txt17") Application("txt17") = Application("txt16") Application("txt16") = Application("txt15") Application("txt15") = Application("txt14") Application("txt14") = Application("txt13") Application("txt13") = Application("txt12") Application("txt12") = Application("txt11") Application("txt11") = Application("txt10") Application("txt10") = Application("txt9") Application("txt9") = Application("txt8") Application("txt8") = Application("txt7") Application("txt7") = Application("txt6") Application("txt6") = Application("txt5") Application("txt5") = Application("txt4") Application("txt4") = Application("txt3") Application("txt3") = Application("txt2") Application("txt2") = Application("txt1") Application("txt1") = "<FONT COLOR=""#00C800"">** " & session("name") & " timed out **</FONT>" APPLICATION.UNLOCK End If End Sub </script> Global.asa # 2 - Online users count: <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart Application("ActiveUsers") = 0 End Sub Sub Session_OnStart Session.Timeout = 3 Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 Application.UnLock End Sub Sub Session_OnEnd Application.Lock Application("ActiveUsers") = Application("ActiveUsers") - 1 Application.UnLock End Sub </SCRIPT> Any help will be very much appriciated. Thanks! Regards, Gedda Quote:
|
|
#5
|
||||
|
||||
|
Gedda,
Just do ask you asked and merge them. Take the code in the same events, and put it into one. For example: Global.asa #1 - ASP Chat: <script language="Vbscript" runat="server"> Sub Application_onStart Application("OnLine") = 0 End Sub ... Global.asa # 2 - Online users count: <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart Application("ActiveUsers") = 0 End Sub ... Global.asa # 3 - Combined: <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Application_OnStart Application("OnLine") = 0 Application("ActiveUsers") = 0 End Sub ... Give that a try and let me know how you fare... |
![]() |
| Viewing: ASP Free Forums > Other > Development Articles > Introduction To The GLOBAL.ASA For ASP Programmers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|