示例#1
0
        public static ModuleSettings GetSettings()
        {
            ModuleSettings data       = null;
            XmlSerializer  serializer = new XmlSerializer(typeof(ModuleSettings));

            try
            {
                string     apppath  = Application.StartupPath;
                string     fileName = apppath + "\\config.xml";
                FileStream fs       = new FileStream(fileName, FileMode.Open);
                data = (ModuleSettings)serializer.Deserialize(fs);
                fs.Close();
            }
            catch
            {
                data = new ModuleSettings();
            }
            return(data);
        }