Settings.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Oreo.CleverDog.Models;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using Y.Utils.DataUtils.JsonUtils;
  7. using Y.Utils.IOUtils.TxtUtils;
  8. using Y.Utils.NetUtils.HttpUtils;
  9. namespace Oreo.CleverDog.Commons
  10. {
  11. /// <summary>
  12. /// 配置信息
  13. /// </summary>
  14. public static class Settings
  15. {
  16. static string ServerUrl = "http://10.49.129.127:8001/noah/webservice/getDownloadSoftwareInfo";
  17. public static void Init()
  18. {
  19. ReadFromWeb();
  20. //ReadFromDemo();
  21. }
  22. public static Frisbee[] Frisbee { get; set; }
  23. public static void ReadFromDemo()
  24. {
  25. //string fb = JsonTool.ToStr(new Frisbee[]{
  26. // new Frisbee() {
  27. // Any3264 ="32",
  28. // Term = DateTime.Parse("2017-7-1"),
  29. // ExistControl=new string[] {"趋势科技防毒墙网络版客户端"},
  30. // ExistFile=new string[] {},
  31. // ExistProcess =new string[] { "PccNTMon"},
  32. // Url = "http://10.49.129.127/file/soft/trend32.exe",
  33. // FileName="trend32.exe",
  34. // SuccUrl="",
  35. // AutoRun=true,
  36. // KillProcess=new string[] { },
  37. // RunProcess=new string[] { }
  38. // },
  39. // new Frisbee() {
  40. // Any3264 ="64",
  41. // Term = DateTime.Parse("2017-7-1"),
  42. // ExistControl=new string[] {"趋势科技防毒墙网络版客户端"},
  43. // ExistFile=new string[] {},
  44. // ExistProcess =new string[] { "PccNTMon"},
  45. // Url = "http://10.49.129.127/file/soft/trend64.exe",
  46. // FileName="trend64.exe",
  47. // SuccUrl="",
  48. // AutoRun=true,
  49. // KillProcess=new string[] { },
  50. // RunProcess=new string[] { }
  51. // },
  52. // });
  53. //TxtTool.Create(@"D:\Temp\Frisbee Data.txt", fb);
  54. Frisbee = JsonTool.ToObjFromFile<Frisbee[]>(@"D:\Temp\Frisbee Data.txt");
  55. }
  56. public static void ReadFromWeb()
  57. {
  58. Frisbee = HttpTool.Get<Frisbee[]>(ServerUrl);
  59. }
  60. }
  61. }