Processer.cs 934 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace HTEXScan.Models
  6. {
  7. /**处理器**/
  8. class Processer
  9. {
  10. /**获取模板**/
  11. public static Template ReadTemplate(string path)
  12. {
  13. string s = System.IO.File.ReadAllText(path);
  14. try
  15. {
  16. return JsonConvert.DeserializeObject<Template>(s);
  17. }
  18. catch(Exception e)
  19. {
  20. }
  21. return null;
  22. }
  23. /**获得答案**/
  24. public static void GetResult(Data data)
  25. {
  26. File stream = new File();
  27. stream.Bind(data);
  28. stream.Read();
  29. }
  30. /**获得答案集合**/
  31. public static void GetResults(List<Data> datas)
  32. {
  33. for (int i = 0; i < datas.Count; i++)
  34. Processer.GetResult(datas[i]);
  35. }
  36. }
  37. }