예제 #1
0
 public static async void RefreshBlockList()
 {
     await Task.Run(() =>
     {
         try
         {
             List <StockInfo> list = new List <StockInfo>();
             FillSZList(ref list, ConfigurationManager.AppSettings["SZListUrl"], HostingEnvironment.MapPath("~") + "\\file\\SZList.xlsx");
             FillSHList(ref list, ConfigurationManager.AppSettings["SHMbmListUrl"], HostingEnvironment.MapPath("~") + "\\file\\SHMbmList.txt");
             FillSHList(ref list, ConfigurationManager.AppSettings["SHStartListUrl"], HostingEnvironment.MapPath("~") + "\\file\\SHStartList.txt");
             if (list.Count > 4000)
             {
                 StockInfoDA.Add(list);
             }
         }
         catch (Exception ex)
         {
             NLog.Error("刷新股票列表失败", ex);
         }
     });
 }
예제 #2
0
 public static void Init()
 {
     block = BlockInfoDA.List();
     stock = StockInfoDA.List();
 }