Looking for a contract position
in Toronto area as a Senior .NET Developer
Toronto, ON, M6P 2P2
Tel: 647.328.3809
Email: 

How to read data from app.config?

It's simple, Just use ConfigurationManager class
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
      <add key="ApplicationPath" value="C:\MyProjects\TestProject\"/>
    </appSettings>
</configuration>
And to read data use this code
public static string AppPath()
{
return ConfigurationManager.AppSettings["ApplicationPath"];
}
Do not forget add reference to the System.Configuration
 
Powered by AtomicCms content management system