Settings.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 void Read()
  28. {
  29. ExistFile = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistFile", "").Split(',');
  30. ExistProcess = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistProcess", "").Split(',');
  31. ExistSetup = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "ExistSetup", "").Split(',');
  32. Url = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "Url", "");
  33. UrlFileName = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "UrlFileName", "");
  34. Run = IniTool.GetStringValue(R.Files.Frisbee, "Frisbee", "Run", "").Split(',');
  35. }
  36. }
  37. }
  38. }