在config中取AppSettings下的值
ConfigurationManager.AppSettings[“AppId”];
例在config中取client 属性的值:
//获取client属性下的值
ClientSection clientSettings = ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
//取client下值
var address = clientSettings.Endpoints[0].Address.ToString()
网友评论