Settings.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Y.Utils.IOUtils.TxtUtils;
  6. namespace Oreo.CleverDog.Commons
  7. {
  8. /// <summary>
  9. /// 配置信息
  10. /// </summary>
  11. public static class Settings
  12. {
  13. public static void Init()
  14. {
  15. Settings.Frisbee.Read();
  16. }
  17. public static class Frisbee
  18. {
  19. // 用来判定程序是否存在
  20. public static string[] ExistFile { get; set; }
  21. public static string[] ExistProcess { get; set; }
  22. public static string[] ExistSetup { get; set; }
  23. // 下载程序并执行
  24. public static string Url { get; set; }
  25. public static string UrlFileName { get; set; }
  26. public static string[] Run { get; set; }
  27. public static string SuccGetUrl { get; set; }
  28. public static void Read()
  29. {
  30. ExistFile = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistFile", "").Split(',');
  31. ExistProcess = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistProcess", "").Split(',');
  32. ExistSetup = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistSetup", "").Split(',');
  33. Url = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "Url", "");
  34. UrlFileName = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "UrlFileName", "");
  35. Run = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "Run", "").Split(',');
  36. SuccGetUrl = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "SuccGetUrl", "");
  37. }
  38. }
  39. }
  40. }