I am writing a program that need to store some configuration information. I thought XML would be a good choice, but I do not want to learn XML in C# from scratch.
Could you recommend good ways/classes handling this task?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just use the built-in .NET configuration system! What’s wrong with that??
For that, add a reference to
System.Configurationto your project, and have a good look at theConfigurationManagerclass in that namespace.Starting with Visual Studio 2005, you can also define application- or user-scoped settings in a visual designer inside VS – check out Application Settings Overview on MSDN for this (those work for Winforms and console apps). Those settings are stored in your
app.config/web.configfor the application-scoped settings, and in a separateuser.configfile in a directory accessible to the user account for the user-scoped settings. Those can be manipulated and updated at runtime using standard .NET classes (from theSystem.Configurationnamespace).