using System; using System.Configuration; using System.Collections.Generic; using System.Linq; using System.Web; public class Global : System.Web.HttpApplication { public static string email_template_dir; public static string root; public Global() { } void Application_Start(object sender, EventArgs e) { try { Application.Lock(); email_template_dir = HttpContext.Current.Server.MapPath("~/emailtemplates"); CommonV2.EmailObject emailObj = new CommonV2.EmailObject(); emailObj.LoadTemplates(email_template_dir); Application["EmailObject"] = emailObj; } finally { Application.UnLock(); } } protected void Application_BeginRequest(Object sender, EventArgs e) { if (Request.ServerVariables["server_name"].IndexOf("creaworld.com.sg") > 0) { root = ConfigurationSettings.AppSettings["LOCALHOST_ROOT"]; } else { root = "/"; } } void Application_End(object sender, EventArgs e) { // Code that runs on application shutdown } void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs } void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started } void Session_End(object sender, EventArgs e) { // Code that runs when a session ends. // Note: The Session_End event is raised only when the sessionstate mode // is set to InProc in the Web.config file. If session mode is set to StateServer // or SQLServer, the event is not raised. } }