Accessing ASP.NET Configuration Settings
You can access public configuration settings from within an ASP.NET application by using the intrinsic static methods exposed by ASP.NET. For example, to read the value of the cookieless attribute of the <sessionState> section, you could use the following line of code.
Dim nocookies As Boolean = Session.IsCookieless [C#] bool nocookies = Session.IsCookieless;
Dim dsn As String = ConfigurationSettings.AppSettings("dsn") [C#] String dsn = ConfigurationSettings.AppSettings["dsn"];