Esempio n. 1
0
 private SystemEnvironment()
 {
     this.m_ConfigFile          = AppDomain.CurrentDomain.BaseDirectory + @"ApplicationConfig.xml";
     this.m_ResourceInfo        = new ResourceInfo(m_ConfigFile);
     this.m_AuthorizationObject = GetAuthorizationObject(this.m_ConfigFile);
     this.m_MapPath             = Directory.GetCurrentDirectory();
 }
Esempio n. 2
0
        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.SystemID          = root.SelectSingleNode("ResourceInfo/SystemID").InnerText;
                obj.SystemName        = root.SelectSingleNode("ResourceInfo/SystemName").InnerText;
                obj.UserCompany       = root.SelectSingleNode("ResourceInfo/UserCompany").InnerText;
                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());
        }