I need to create a project config file(i.e. project.config or project.ini) so that I can later use it store the preference selected by the user. When the application launches, it will automatically load that config file and customize the application based on the previous settings.
Is there a good way to do this in C# 4.0?
I used to manually do all these labor work by manipulating a file in C++ and I expect to get a cleaner and easier solution with .NET.
Thank you
For WinForms and WPF, consider using the Application Settings built-in. No need to roll your own, in this case. This is a way to create and store settings data on behalf of your application and your users.
predefine the settings you’d like the user to be able to save. Let’s say it’s
WindowSize, andBackgroundImage.access these properties like so:
This persists to
yourAppName.exe.config.