1.nuget 搜索consul安装

2.

using (var client = new ConsulClient())
{
var kvPair = client.KV.Get(key).Result; if (kvPair.Response != null && kvPair.Response.Value != null)
{
return Encoding.UTF8.GetString(kvPair.Response.Value, 0, kvPair.Response.Value.Length);
} return string.Empty;
}

  

05-11 16:03