美文网首页
在config中取值

在config中取值

作者: 秒怂的哈士奇爱吃西瓜 | 来源:发表于2021-05-14 14:47 被阅读0次

在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()

相关文章

网友评论

      本文标题:在config中取值

      本文链接:https://www.haomeiwen.com/subject/pryqjltx.html