コード例 #1
0
 /// <summary>
 /// 初始化扫描
 /// </summary>
 /// <param name="UserDataJson"></param>
 private static void InitScanner(string UserDataJson)
 {
     try
     {
         string ReadJson = FileHelper.ReadContextUtf8(StaticValue.UserInfoPath + UserDataJson + ".json");
         Tool.AddSite.AddHelper.UserData ALLJson = JsonConvert.DeserializeObject <Tool.AddSite.AddHelper.UserData>(ReadJson);
         string        Shtml    = WebHelper.HttpGet(ALLJson.WebLink1);
         List <string> TempList = HtmlHelper.GetLinkVlaueList(Shtml, ALLJson.Xpath1);
         foreach (string Line in TempList)
         {
             string Temptext = Line + DateTime.Now.ToString("yyyyMMdd");
             if (!StaticValue.LogList.Contains(Temptext))
             {
                 Console.WriteLine("加入{0}", Line);
                 PrintLog.ReflushLog(StaticValue.UrlLogFile, StaticValue.LogList, Temptext);
                 FileHelper.AppendUTF8Text(StaticValue.SiteLogFloderPath + UserDataJson + DateTime.Now.ToString("yyyyMMdd"), Temptext);
             }
         }
     }
     catch (Exception ex) {
         PrintLog.Log(ex);
     }
 }