Application Settings
-
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.
-
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.
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[^]
-
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.
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
-
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[^]
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[^]
-
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
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. :)
-
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. :)