TmpService.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using Library;
  4. using LitJson;
  5. using System.Linq;
  6. using System.Data;
  7. using System.Threading;
  8. using MySystem.PxcModels;
  9. namespace MySystem
  10. {
  11. public class TmpService
  12. {
  13. public readonly static TmpService Instance = new TmpService();
  14. private TmpService()
  15. { }
  16. public void Start()
  17. {
  18. Thread th = new Thread(dosomething);
  19. th.IsBackground = true;
  20. th.Start();
  21. }
  22. public void dosomething()
  23. {
  24. string content = function.ReadInstance("jk299.txt");
  25. string[] SnNos = content.Split('\n');
  26. int count = SnNos.Length;
  27. int index = 0;
  28. foreach(string SnNo in SnNos)
  29. {
  30. index += 1;
  31. PublicImportDataService.Instance.LkbSetDeposit(SnNo, 299);
  32. function.WritePage("/look/", "progress.txt", index + "/" + count);
  33. function.WritePage("/look/", "sn.txt", SnNo);
  34. Thread.Sleep(100);
  35. }
  36. content = function.ReadInstance("jk0.txt");
  37. SnNos = content.Split('\n');
  38. count = SnNos.Length;
  39. index = 0;
  40. foreach(string SnNo in SnNos)
  41. {
  42. index += 1;
  43. PublicImportDataService.Instance.LkbSetDeposit(SnNo, 0);
  44. function.WritePage("/look/", "progress.txt", index + "/" + count);
  45. function.WritePage("/look/", "sn.txt", SnNo);
  46. Thread.Sleep(100);
  47. }
  48. }
  49. }
  50. }