Эх сурвалжийг харах

wifi订单交易统计定时执行时间限制

lcl 11 сар өмнө
parent
commit
805d558d23

+ 8 - 5
AppStart/WifiTradeHelper.cs

@@ -28,12 +28,15 @@ public class WifiTradeHelper
         {
         {
             try
             try
             {
             {
-                string Month = DateTime.Now.ToString("yyyyMM");
-                string chk = function.ReadInstance("/wifi/trade" + Month + ".txt");
-                if(string.IsNullOrEmpty(chk))
+                if(DateTime.Now.Day == 1 && DateTime.Now.Hour < 6)
                 {
                 {
-                    function.WritePage("/wifi/", "trade" + Month + ".txt", DateTime.Now.ToString());
-                    DoSomething(Month);
+                    string Month = DateTime.Now.ToString("yyyyMM");
+                    string chk = function.ReadInstance("/wifi/trade" + Month + ".txt");
+                    if(string.IsNullOrEmpty(chk))
+                    {
+                        function.WritePage("/wifi/", "trade" + Month + ".txt", DateTime.Now.ToString());
+                        DoSomething(Month);
+                    }
                 }
                 }
                 Thread.Sleep(3600000);
                 Thread.Sleep(3600000);
             }
             }