示例#1
0
        public static void InitGlobalSetting()
        {
            string path = SettingXmlPath;

            Setting.Setting setting = null;
            //读取setting.xml列表(.xml)
            List <string> settingList = XmlHelper.LoadXMlList(path, "xml");

            foreach (string i in settingList)
            {
                if (i.ToLower() == "setting.xml")
                {
                    setting = SettingXmlHandle.ReadXml(i, path);
                    break;
                }
            }
            //init GlobalSetting
            GlobalSetting.Clear();
            GlobalSetting.UserAgent        = setting.UserAgent;
            GlobalSetting.HttpHeader       = setting.HttpHeader;
            GlobalSetting.IsParamRandom    = setting.IsParamRandom;
            GlobalSetting.IsShowDisclaimer = setting.IsShowDisclaimer;
            GlobalSetting.Proxy            = setting.Proxy;
            GlobalSetting.Setting          = setting;
        }
示例#2
0
 public static void SaveSettingToXml(Setting.Setting setting)
 {
     SettingXmlHandle.WriteXml("setting.xml", SettingXmlPath, setting);
 }