Beispiel #1
0
 private bool SaveSiteSettings(out string errorMsg)
 {
     errorMsg = null;
     if (this.siteName.Length <= 30 && this.siteDescription.Length <= 30)
     {
         bool result;
         try
         {
             string filename = base.Request.MapPath(Globals.ApplicationPath + "/config/SiteSettings.config");
             System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument();
             Hidistro.Membership.Context.SiteSettings siteSettings = new Hidistro.Membership.Context.SiteSettings(base.Request.Url.Host, null);
             xmlDocument.LoadXml("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + System.Environment.NewLine + "<Settings></Settings>");
             siteSettings.SiteName        = this.siteName;
             siteSettings.SiteDescription = this.siteDescription;
             siteSettings.WriteToXml(xmlDocument);
             xmlDocument.Save(filename);
             result = true;
         }
         catch (System.Exception ex)
         {
             errorMsg = ex.Message;
             result   = false;
         }
         return(result);
     }
     errorMsg = "网店名称和简单介绍的长度不能超过30个字符";
     return(false);
 }
        private static void SaveMasterSettings(SiteSettings settings)
        {
            string      masterSettingsFilename = GetMasterSettingsFilename();
            XmlDocument doc = new XmlDocument();

            if (File.Exists(masterSettingsFilename))
            {
                doc.Load(masterSettingsFilename);
            }
            settings.WriteToXml(doc);
            doc.Save(masterSettingsFilename);
        }
Beispiel #3
0
        private static void smethod_1(SiteSettings siteSettings_0)
        {
            string      text        = SettingsManager.smethod_0();
            XmlDocument xmlDocument = new XmlDocument();

            if (System.IO.File.Exists(text))
            {
                xmlDocument.Load(text);
            }
            siteSettings_0.WriteToXml(xmlDocument);
            xmlDocument.Save(text);
        }