OpenApiSection.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Configuration;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace cuidian.Common
  9. {
  10. public class OpenApiSection
  11. {
  12. private OpenApiSection()
  13. {
  14. NameValueCollection nvc = ConfigManager.GetSection("OpenApi");
  15. __appkey = nvc["AppKey"];
  16. __fromAccount = nvc["FromAccount"];
  17. __toAccount = nvc["ToAccount"];
  18. __appSecret = nvc["AppSecret"];
  19. __baseUrl = nvc["BaseUrl"];
  20. }
  21. private string __appkey, __fromAccount, __toAccount, __appSecret, __baseUrl;
  22. private static OpenApiSection __singleton = new OpenApiSection();
  23. public static OpenApiSection Instance
  24. {
  25. get { return __singleton; }
  26. }
  27. public string AppKey
  28. {
  29. get { return __appkey; }
  30. }
  31. public string FromAccount
  32. {
  33. get { return __fromAccount; }
  34. }
  35. public string ToAccount
  36. {
  37. get { return __toAccount; }
  38. }
  39. public string AppSecret
  40. {
  41. get { return __appSecret; }
  42. }
  43. public string BaseUrl
  44. {
  45. get { return __baseUrl; }
  46. }
  47. }
  48. }