How to get values from App.Config.
Code:
<configuration>
<appSettings>
<add key="ShowRoomCode" value="1000"/>
<add key="FolderPath" value="D:\\Images\\Book\\"/>
</appSettings>
</configuration>
string imageFolderPath = ConfigurationManager.AppSettings["FolderPath"];
But it returns null value. Config file is in the Same project.
The code you wrote should work - make sure you haven't changed 'BuildAction' of the config file.
If you expand the Properties section of Visual Studio and double click the settings section, you will be able to add custom settings which end up like so in the config file:
Which you can then do this in your code:
Which is nice because it gives you type safety too