浏览代码

推荐王重启

lcl 3 周之前
父节点
当前提交
4b1be7ea24
共有 1 个文件被更改,包括 33 次插入33 次删除
  1. 33 33
      AppStart/Helper/RecommandKingHelper.cs

+ 33 - 33
AppStart/Helper/RecommandKingHelper.cs

@@ -26,41 +26,41 @@ namespace MySystem
         }
         public void StartFor()
         {
-            // while (true)
-            // {
-            //     if(DateTime.Now.Hour > 13 && DateTime.Now.Hour < 23)
-            //     {
-            //         string today = DateTime.Now.ToString("yyyy-MM-dd");
-            //         string checkFlag = function.ReadInstance("/RecommandKing/" + today + ".txt");
-            //         if(string.IsNullOrEmpty(checkFlag))
-            //         {
-            //             function.WritePage("/RecommandKing/", today + ".txt", DateTime.Now.ToString());
-
-            //             if(DateTime.Now.Day == 2)
-            //             {
-            //                 Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 1);
-            //                 Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 2);
-            //                 // Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 3);
-            //             }
-            //             Recommend(DateTime.Now.ToString("yyyyMM"), 1);
-            //             Recommend(DateTime.Now.ToString("yyyyMM"), 2);
-            //             // Recommend(DateTime.Now.ToString("yyyyMM"), 3);
-            //         }
-            //     }
-            //     Thread.Sleep(600000);
-            // }
-            string today = DateTime.Now.ToString("yyyy-MM-dd");
-            string checkFlag = function.ReadInstance("/RecommandKing/" + today + ".txt");
-            if(string.IsNullOrEmpty(checkFlag))
+            while (true)
             {
-                function.WritePage("/RecommandKing/", today + ".txt", DateTime.Now.ToString());
-                Recommend(DateTime.Now.AddMonths(-2).ToString("yyyyMM"), 1);
-                Recommend(DateTime.Now.AddMonths(-2).ToString("yyyyMM"), 2);
-                Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 1);
-                Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 2);
-                Recommend(DateTime.Now.ToString("yyyyMM"), 1);
-                Recommend(DateTime.Now.ToString("yyyyMM"), 2);
+                if(DateTime.Now.Hour > 13 && DateTime.Now.Hour < 23)
+                {
+                    string today = DateTime.Now.ToString("yyyy-MM-dd");
+                    string checkFlag = function.ReadInstance("/RecommandKing/" + today + ".txt");
+                    if(string.IsNullOrEmpty(checkFlag))
+                    {
+                        function.WritePage("/RecommandKing/", today + ".txt", DateTime.Now.ToString());
+
+                        if(DateTime.Now.Day == 2)
+                        {
+                            Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 1);
+                            Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 2);
+                            // Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 3);
+                        }
+                        Recommend(DateTime.Now.ToString("yyyyMM"), 1);
+                        Recommend(DateTime.Now.ToString("yyyyMM"), 2);
+                        // Recommend(DateTime.Now.ToString("yyyyMM"), 3);
+                    }
+                }
+                Thread.Sleep(600000);
             }
+            // string today = DateTime.Now.ToString("yyyy-MM-dd");
+            // string checkFlag = function.ReadInstance("/RecommandKing/" + today + ".txt");
+            // if(string.IsNullOrEmpty(checkFlag))
+            // {
+            //     function.WritePage("/RecommandKing/", today + ".txt", DateTime.Now.ToString());
+            //     Recommend(DateTime.Now.AddMonths(-2).ToString("yyyyMM"), 1);
+            //     Recommend(DateTime.Now.AddMonths(-2).ToString("yyyyMM"), 2);
+            //     Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 1);
+            //     Recommend(DateTime.Now.AddMonths(-1).ToString("yyyyMM"), 2);
+            //     Recommend(DateTime.Now.ToString("yyyyMM"), 1);
+            //     Recommend(DateTime.Now.ToString("yyyyMM"), 2);
+            // }
         }
         public void Recommend(string TradeMonth, int Kind)
         {