TmpService.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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("jk0.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, 0);
  32. function.WritePage("/look/", "progress.txt", index + "/" + count);
  33. function.WritePage("/look/", "sn.txt", SnNo);
  34. Thread.Sleep(100);
  35. }
  36. }
  37. }
  38. }