ASP Application_OnStart() - Application Object Function in the Global.asa file. if application first connect to web server.
ShotDev Focus:
- Application_OnStart()
Example
global.asa
<script language="VBScript" runat="Server">
Sub Application_OnStart
Set Application("Zip") = Server.CreateObject("Pnvzip.ZipFunctions")
End Sub
Sub Application_End
Set Application("Zip") = Nothing
End Sub
</script>
asp_application_onstart.asp
<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim sResult
sResult = Application("Zip").ZipFile(Server.MapPath("MyFiles/shotdev.txt"),Server.MapPath("MyFiles/shotdev.zip"))
Response.Write "Result code :" & sResult & "<br>"
%>
</body>
</html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_application_onstart.asp
Screenshot
.
.
.
Download this script.


