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. Application Settings

Application Settings

Scheduled Pinned Locked Moved C#
csharpvisual-studiodebuggingquestion
6 Posts 4 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.
  • M Offline
    M Offline
    Midnight Ahri
    wrote on last edited by
    #1

    I'm new to this, or precisely just realize that visual studio had this in the properties folder below visual studio project. I'm planning to put important things like connection strings inside. I tried to save a simple text in the setting and save it. When I run the application, in the debug folder appear "WindowsFormsApplication1.exe.config" file. I know that it's the setting I created, but the value of the setting is not inside. When I re-run the application, it was able to load the text i saved before. Where did the setting save the value? :omg: Btw sorry for bad english.

    K L 2 Replies Last reply
    0
    • M Midnight Ahri

      I'm new to this, or precisely just realize that visual studio had this in the properties folder below visual studio project. I'm planning to put important things like connection strings inside. I tried to save a simple text in the setting and save it. When I run the application, in the debug folder appear "WindowsFormsApplication1.exe.config" file. I know that it's the setting I created, but the value of the setting is not inside. When I re-run the application, it was able to load the text i saved before. Where did the setting save the value? :omg: Btw sorry for bad english.

      K Offline
      K Offline
      Kenneth Haugland
      wrote on last edited by
      #2

      Can you give us some code to go on here? BTW: You can save the text in a resource file like this: WPF Localization Using RESX Files[^]

      M 1 Reply Last reply
      0
      • M Midnight Ahri

        I'm new to this, or precisely just realize that visual studio had this in the properties folder below visual studio project. I'm planning to put important things like connection strings inside. I tried to save a simple text in the setting and save it. When I run the application, in the debug folder appear "WindowsFormsApplication1.exe.config" file. I know that it's the setting I created, but the value of the setting is not inside. When I re-run the application, it was able to load the text i saved before. Where did the setting save the value? :omg: Btw sorry for bad english.

        L Offline
        L Offline
        lukeer
        wrote on last edited by
        #3

        That's only one of the config files. It's like a blueprint holding the values you enter in Visual Studio at coding time. What your application saves at runtime is stored in a user-dependent copy of that file somewhere in the region of "Documents and Settings/$YourUserName$/Application Data/$Company$/$ApplicationNameWithSomeAlphaNumericFuzz$/$ProductVersion$/user.config" The exact location may depend on your OS version.

        Ciao, luker

        M 1 Reply Last reply
        0
        • K Kenneth Haugland

          Can you give us some code to go on here? BTW: You can save the text in a resource file like this: WPF Localization Using RESX Files[^]

          M Offline
          M Offline
          Midnight Ahri
          wrote on last edited by
          #4

          private void button1_Click(object sender, EventArgs e)
          {
          Properties.Settings.Default.Constr = this.textBox1.Text;
          Properties.Settings.Default.Save();
          }

              private void Form1\_Load(object sender, EventArgs e)
              {
                  this.textBox1.Text = Properties.Settings.Default.Constr;
              }
          

          Constr is the setting I create. Actually I'm going to put licensing there too, of course I will encrypt it before I save. Now I still can't find it. This is what I use > http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx[^]

          1 Reply Last reply
          0
          • L lukeer

            That's only one of the config files. It's like a blueprint holding the values you enter in Visual Studio at coding time. What your application saves at runtime is stored in a user-dependent copy of that file somewhere in the region of "Documents and Settings/$YourUserName$/Application Data/$Company$/$ApplicationNameWithSomeAlphaNumericFuzz$/$ProductVersion$/user.config" The exact location may depend on your OS version.

            Ciao, luker

            M Offline
            M Offline
            Midnight Ahri
            wrote on last edited by
            #5

            lukeer wrote:

            "Documents and Settings/$YourUserName$/Application Data/$Company$/$ApplicationNameWithSomeAlphaNumericFuzz$/$ProductVersion$/user.config"

            I found this but nothing inside.

            "C:\Documents and Settings\Administrator\Application Data\Microsoft Corporation\Microsoft (R) Visual Studio (R) 2010\1.0.30319.1"

            There are no strange company name in Application Data. Btw thank you for answering. Edit : I found it here[^] It's just like what you answered, I missed Local Settings before Application Data. Thank you very much. :)

            L 1 Reply Last reply
            0
            • M Midnight Ahri

              lukeer wrote:

              "Documents and Settings/$YourUserName$/Application Data/$Company$/$ApplicationNameWithSomeAlphaNumericFuzz$/$ProductVersion$/user.config"

              I found this but nothing inside.

              "C:\Documents and Settings\Administrator\Application Data\Microsoft Corporation\Microsoft (R) Visual Studio (R) 2010\1.0.30319.1"

              There are no strange company name in Application Data. Btw thank you for answering. Edit : I found it here[^] It's just like what you answered, I missed Local Settings before Application Data. Thank you very much. :)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Midnight Ahri wrote:

              I found it here[^]

              Documented on MSDN[^].

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              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