获取Web.config配置节
原创
©著作权归作者所有:来自51CTO博客作者TwcatL_tree的原创作品,请联系作者获取转载授权,否则将追究法律责任
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);