D
David
I just tried out, for the first time, an app.config file for a Windows forms
app. What could be simpler? Edit the file and save it, then create an
System.Configuration.AppSettingsReader object. Write a line of code for the
setting to retrieve and, done! Fantastic.
So, I thought, there is probably an AppSettingsWriter class. No? No. I
looked through the System.Configuration namespace, and saw lots of ways to do
what I wanted to do, but none of them jumped out at me as the best way to do
it with the least amount of coding.
All I want to do is store a couple of settings that the user makes during
program execution. For example, my particular program can run three copies
of equipment, so the user has to select which one he is using. However,
after the first time he does this, the computer stays with the machine, so I
would like to save it as the default, and read it out of the app.config file,
so he doesn't have to select it next time. Is there a "lazy programmer's
guide to using the app.config file for storing user data"?
app. What could be simpler? Edit the file and save it, then create an
System.Configuration.AppSettingsReader object. Write a line of code for the
setting to retrieve and, done! Fantastic.
So, I thought, there is probably an AppSettingsWriter class. No? No. I
looked through the System.Configuration namespace, and saw lots of ways to do
what I wanted to do, but none of them jumped out at me as the best way to do
it with the least amount of coding.
All I want to do is store a couple of settings that the user makes during
program execution. For example, my particular program can run three copies
of equipment, so the user has to select which one he is using. However,
after the first time he does this, the computer stays with the machine, so I
would like to save it as the default, and read it out of the app.config file,
so he doesn't have to select it next time. Is there a "lazy programmer's
guide to using the app.config file for storing user data"?