private SystemEnvironment() { string processname = System.Diagnostics.Process.GetCurrentProcess().ProcessName.ToLower(); //this.m_ConfigFile = System.Configuration.ConfigurationManager.AppSettings["ConfigPath"].ToString() + "ApplicationConfig.xml"; this.m_ConfigFile = _MapPath("/App_Config/ApplicationConfig.xml"); this.m_ResourceInfo = new ResourceInfo(m_ConfigFile); this.m_AuthorizationObject = GetAuthorizationObject(this.m_ConfigFile); //this.m_MapPath = System.Configuration.ConfigurationManager.AppSettings["MapPath"].ToString(); this.m_ReviewederObject = GetReviewederObject(this.m_ConfigFile); this.m_MapPath = _MapPath(""); }
/// <summary> /// 获取权限对象 /// </summary> /// <param name="applicationConfigFile"></param> /// <returns></returns> private AuthorizationObject GetAuthorizationObject(string applicationConfigFile) { System.Xml.XmlDocument xmldom = new System.Xml.XmlDocument(); xmldom.Load(applicationConfigFile); System.Xml.XmlNode root = xmldom.DocumentElement; try { AuthorizationObject obj = new AuthorizationObject(); obj.DefaultDataSource = root.SelectSingleNode("ResourceInfo/DefaultDataSource").InnerText; obj.DevelopeCompany = root.SelectSingleNode("ResourceInfo/DevelopeCompany").InnerText; obj.ReleaseDate = root.SelectSingleNode("ResourceInfo/ReleaseDate").InnerText; obj.ExpiryDate = root.SelectSingleNode("ResourceInfo/ExpiryDate").InnerText; obj.Version = root.SelectSingleNode("ResourceInfo/Version").InnerText; return(obj); } catch { } return(new AuthorizationObject()); }