using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; namespace cuidian.Common { public class OpenApiSection { private OpenApiSection() { NameValueCollection nvc = ConfigManager.GetSection("OpenApi"); __appkey = nvc["AppKey"]; __fromAccount = nvc["FromAccount"]; __toAccount = nvc["ToAccount"]; __appSecret = nvc["AppSecret"]; __baseUrl = nvc["BaseUrl"]; } private string __appkey, __fromAccount, __toAccount, __appSecret, __baseUrl; private static OpenApiSection __singleton = new OpenApiSection(); public static OpenApiSection Instance { get { return __singleton; } } public string AppKey { get { return __appkey; } } public string FromAccount { get { return __fromAccount; } } public string ToAccount { get { return __toAccount; } } public string AppSecret { get { return __appSecret; } } public string BaseUrl { get { return __baseUrl; } } } }