Monday, November 11, 2013

How to use app.config (Windows Form) and web.config (Web based) file for C# applications

Once you create a web based application project, by default Web.Config file will be appear under solution Explorer.



If you create Windows based or Console application, there won’t be any config file under solution explorer, so we need to create manually.






Always try to use the Visual Studio IntelliSense to add variables, because there can be many possibilities to make mistakes such as spelling mistakes and wrong key words.


First add the key word:



Then add user values into the relevant places.


In the application, first need to add the System.Configuration object reference

For windows form and console application:






For web based application:





Cheers!


No comments:

Post a Comment