CatchDemo.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace CB.LotteryCatchData.Demo
  10. {
  11. public partial class CatchDemo : Form
  12. {
  13. public CatchDemo()
  14. {
  15. InitializeComponent();
  16. }
  17. private void button1_Click(object sender, EventArgs e)
  18. {
  19. var config = CB.LotteryCatchData.Config.CatchDataConfigs.GetConfig();
  20. if (null == config || null == config.List || 0 >= config.List.Count)
  21. {
  22. CB.Common.FileUtil.WriteLog("配置文件无效");
  23. return;
  24. }
  25. foreach (var item in config.List)
  26. {
  27. try
  28. {
  29. CB.LotteryCatchData.CatchData.CatchLotteryData(item);
  30. }
  31. catch (Exception ex)
  32. { CB.Common.FileUtil.WriteLog(string.Format(item.Name + "抓取异常:{0} \r\n", ex)); }
  33. }
  34. }
  35. }
  36. }