示例#1
0
文件: Task.cs 项目: pkujf/StockHelper
 /// <summary>
 /// 下载股票列表
 /// </summary>
 public void DownloadStockList()
 {
     try
     {
         HttpWebRequestHelper requestHelper = new HttpWebRequestHelper();
         string getStockListUrl             = DataHelper.GetConfig("getStockListUrl");
         string getPlateCode = DataHelper.GetConfig("getPlateCode");
         string htmlSource   = requestHelper.GetHtmlSource(getStockListUrl, Encoding.Default);
         var    stockList    = GetStockList(htmlSource, getPlateCode);
         foreach (var item in stockList)
         {
             var res = proc.insertUpdateStockList(item.Key, item.Value);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog("下载股票列表失败", ex);
     }
 }