Get SharePoint Configuration

This demonstrates how to get a SharePoint web.config key/value pair.

Reference
Microsoft.Sharepoint (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll)

System.Configuration

Code
public static string GetConfigurationValue(string key, SPSite site) {    if (SPContext.Current == null) {        return WebConfigurationManager.OpenWebConfiguration("/", site.WebApplication.Name).AppSettings.Settings[key].Value; }    else return ConfigurationManager.AppSettings[key]; }