using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Security; using System.Web.SessionState; using QMFrameWork.ServiceLibrary; using QMFrameWork.Cache; namespace QMFrameWork.WebServiceHost { public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { //配置日志处理组件 QMFrameWork.Log.LogManager.Configure("log4net"); //设置sap接口信息 SapInterface.SapInterfaceFactory.Config(); try { //加载数据关联更新信息 string dllPath = System.Web.HttpContext.Current.Server.MapPath("~/Bin/"); List serviceFiles = new List(); serviceFiles.Add(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/PLMServiceList.xml")); serviceFiles.Add(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/MDServiceList.xml")); serviceFiles.Add(System.Web.HttpContext.Current.Server.MapPath("~/App_Data/FJCServiceList.xml")); //启动服务 ServiceEngine.Start(dllPath, serviceFiles); //刷新数据锁定标志 new GeneralService().RefreshDataLock(); QMAPP.FJC.BLL.X_Gate.LightController.Load(); } catch (Exception ex) { QMFrameWork.Log.LogManager.LogHelper.Error( new QMFrameWork.Log.LogInfo { ClientIP = "localhost", UserName = "admin", Info = "应用启动", ErrorInfo = ex }); throw ex; } } protected void Session_Start(object sender, EventArgs e) { } protected void Application_BeginRequest(object sender, EventArgs e) { } protected void Application_AuthenticateRequest(object sender, EventArgs e) { } protected void Application_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); QMFrameWork.Log.LogManager.LogHelper.Error( new QMFrameWork.Log.LogInfo { ClientIP = "localhost", UserName = "admin", Info = "服务运行", ErrorInfo = ex }); } protected void Session_End(object sender, EventArgs e) { } protected void Application_End(object sender, EventArgs e) { //停止服务 ServiceEngine.Stop(); } } }