Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. app config

app config

Scheduled Pinned Locked Moved C#
helpquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cyrus IRA
    wrote on last edited by
    #1

    Problem occurs when I exit out of the application. static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } Whatever has been written to my config file and saved to the file goes back to what it used to before. I have no idea why ? Do you guys have any idea? System.Configuration.Configuration config = null; config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(strJob, strValue); config.Save();

    L 1 Reply Last reply
    0
    • C Cyrus IRA

      Problem occurs when I exit out of the application. static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } Whatever has been written to my config file and saved to the file goes back to what it used to before. I have no idea why ? Do you guys have any idea? System.Configuration.Configuration config = null; config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(strJob, strValue); config.Save();

      L Offline
      L Offline
      Leonscape
      wrote on last edited by
      #2

      Your asking for information that applies to all users, by specifying ConfigurationUserLevel.None. Not a per user level, which is what your trying to save. Try the other types. Also settings should be user level and not application level. Or they'll never change anyway.

      Using the wrong tool for the job is half the fun.

      C 1 Reply Last reply
      0
      • L Leonscape

        Your asking for information that applies to all users, by specifying ConfigurationUserLevel.None. Not a per user level, which is what your trying to save. Try the other types. Also settings should be user level and not application level. Or they'll never change anyway.

        Using the wrong tool for the job is half the fun.

        C Offline
        C Offline
        Cyrus IRA
        wrote on last edited by
        #3

        Tried config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoaming); crashed at Config.Save.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups