Now I'm curious what are possibilities to store/load settings in .net. For example I need to store user name/password for different db's and etc.., also I need to store some options and etc.
My though was to create [Seriazable] class and save it to file...
What can You suggest? what are possibilities in .net and etc.
The .NET Framework provides some mechanisms for storing and loading application and/or user settings. See "MSDN: Using Settings in C#" for the basics.
To encrypt some sensible data within your configuration files you can also use some standard functions of the .NET Framework. For a short introduction take a look at "Encrypting Configuration Information Using Protected Configuration" and "Encrypting Passwords in a .NET app.config File".
I recommend store where you need to App.Config, an Ini file... Then use the library Config.Net: A comprehensive easy to use and powerful .NET configuration library, fully covered with unit tests and tested in the wild on thousands of servers and applications. Found it in GitHub: https://github.com/aloneguid/config
So you can have your settings in a place, and later, if you need to, move to another.
If you want to store application configuration settings, you can leverage the 'AppSettings' in the App.Config or Web.Config file depending on if its a windows or web application. I believe the syntax for reading the configuration values is
The configuration file will look like this
With probably lots of other stuff.
If you need to store information about users or other repeated entities in your system, you will need to build a database and write code to persist / read data to / from the database.
You could make a class serializable and automatically serialize it to XML or Binary, OR you could use a SQL database. There are many .net technologies for accesing databases just look up ADO.net , LINQ and the Entity Framework.
You can use the resource files for less sensitive info. For usernames/passwords you need to use an ecrypted text file, or make use of CSPs.
Well the most common way of storing and loading settings is to use some kind of XML data, and making a [Serializable] class and outputting the serialized class to an XML file would work, but you have to keep the following things in mind: