获取Web.config配置节

        static string GetAppSetting(string key)
        {
            var appSetting = ConfigurationManager.AppSettings[key];
            if (string.IsNullOrEmpty(appSetting))
            {
                return string.Format("未配置节点" + key);
            }
            return appSetting;
        }

        public static string JsonServiceUrl(string key)
        {
            return GetAppSetting(key);
        }
//var url = Configurator.JsonServiceUrl("DownFile");


var apiMethodName = request.QueryString[apiMethodKey];

var apiBaseUrl = Configurator.GetConfigValue("memberDomain");
var apiUrl = string.Format(apiBaseUrl, apiMethodName);
原文地址:https://www.cnblogs.com/shy1766IT/p/5324820.html