CashSignHelper.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MySystem.Models;
  5. using Library;
  6. using LitJson;
  7. using System.Threading;
  8. namespace MySystem
  9. {
  10. public class CashSignHelper
  11. {
  12. public readonly static CashSignHelper Instance = new CashSignHelper();
  13. private CashSignHelper()
  14. { }
  15. public void Start()
  16. {
  17. Thread th = new Thread(StartDo);
  18. th.IsBackground = true;
  19. th.Start();
  20. }
  21. public void StartDo()
  22. {
  23. while (true)
  24. {
  25. try
  26. {
  27. WebCMSEntities db = new WebCMSEntities();
  28. db.SaveChanges();
  29. db.Dispose();
  30. }
  31. catch (Exception ex)
  32. {
  33. function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "代付签约异常");
  34. }
  35. Thread.Sleep(1000);
  36. }
  37. }
  38. }
  39. }