Exemplo n.º 1
0
        private void SaveSetting()
        {
            string path = Directory.GetCurrentDirectory() + "\\crawler.xml";

            if (crawlerInfo == null)
            {
                crawlerInfo = new CrawlerInfo();
            }
            XmlUtil.SerializeObject <CrawlerInfo>(crawlerInfo, path);
        }
Exemplo n.º 2
0
        private void LoadSetting()
        {
            string path = Directory.GetCurrentDirectory() + "\\crawler.xml";

            if (File.Exists(path))
            {
                crawlerInfo = XmlUtil.DeSerializeObject <CrawlerInfo>(path);
            }
            else
            {
                crawlerInfo = new CrawlerInfo();
            }
        }
Exemplo n.º 3
0
        async Task Init()
        {
            await Task.Delay(100);

            crawlerInfo = crawlerInfoSet.FirstOrDefault(a => a.BeginUnicode == beginUnicode && a.EndUnicode == endUnicode);
            if (crawlerInfo == null)
            {
                crawlerInfo = new CrawlerInfo
                {
                    BeginUnicode = beginUnicode,
                    EndUnicode   = endUnicode,
                    Unicode      = 0,
                    ModifiedTime = DateTime.Now,
                };
                crawlerInfoSet.Add(crawlerInfo);
            }
        }