mohamed osama

mohamed osama

  • NA
  • 1
  • 3.6k

what is this ??? LocalFileSettingsProvider

Oct 22 2012 9:12 AM
in the following piece of code ,I don't know what I should put instead of LocalFileSettingsProvider (first line of code)
Please help ,please provide a detailed instruction as I am new for this settings thing,

  SettingsProvider sp = settings.Providers ["LocalFileSettingsProvider"];            
            SettingsProperty p = new SettingsProperty("your_prop_name");
            your_class conf = null;
            p.PropertyType = typeof(your_class);
            p.Attributes.Add(typeof(UserScopedSettingAttribute), new UserScopedSettingAttribute());
            p.Provider = sp;
            p.SerializeAs = SettingsSerializeAs.Xml;
            SettingsPropertyValue v = new SettingsPropertyValue(p);
            settings.Properties.Add(p);

            settings.Reload();
            conf = (your_class)settings["your_prop_name"];
            if (conf == null)
            {
                settings["your_prop_name"] = conf = new your_class();
                settings.Save();
            }

Answers (1)