How to read appSettings section in the web.config file?
Since you're accessing a web.config
you should probably use
using System.Web.Configuration;
WebConfigurationManager.AppSettings["configFile"]
Add namespace
using System.Configuration;
and in place of
ConfigurationSettings.AppSettings
you should use
ConfigurationManager.AppSettings
String path = ConfigurationManager.AppSettings["configFile"];
You should add System.configuration dll as reference and use System.Configuration.ConfigurationManager.AppSettings["configFile"].ToString
Don't forget to add using
statement at the beginning. Hope it will help.
ConfigurationManager.AppSettings["configFile"]
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.appsettings.aspx