コード例 #1
0
        private AccessControlServerSettings GetAccessControlServerSettings(string path)
        {
            AccessControlServerSettings settings = null;

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(AccessControlServerSettings));
                Stream        fs         = File.OpenRead(path);

                settings = (AccessControlServerSettings)serializer.Deserialize(fs);
                fs.Close();
            }
            catch (Exception ex)
            {
                Trace.WriteLine("Failed to load AccessControlServerSettings: " + ex.Message);
            }
            return(settings);
        }
コード例 #2
0
        /// <summary>
        /// SaveAccessControlServerSettings to XML File
        /// </summary>
        /// <param name="setting">AccessControlServer Settings to write to disk.</param>
        public void SaveAccessControlServerSettings(AccessControlServerSettings setting)
        {
            string path = GetFullPath(AccessControlServerSettingsFileName);

            SaveXML <AccessControlServerSettings>(setting, path);
        }