Exemple #1
0
 /// <summary>
 /// 插入已访问记录
 /// </summary>
 private static void InsertVisited()
 {
     if (_news != null)
     {
         MysqlHelper mysqlhelper = new MysqlHelper();
         mysqlhelper.InsertVisited(_news);
     }
 }
Exemple #2
0
        /// <summary>
        /// 获取所有的种子链接
        /// </summary>
        private void InitSeeds()
        {
            MysqlHelper  mysqlHelper = new MysqlHelper();
            List <MyUri> seeds       = mysqlHelper.SelectAllSeeds();

            if (seeds.Count != 0)
            {
                Monitor.Enter(_UriSeedQueue);
                foreach (var uri in seeds)
                {
                    _UriSeedQueue.Enqueue(uri);
                }
                Monitor.Exit(_UriSeedQueue);
            }
        }
Exemple #3
0
 /// <summary>
 /// 插入新闻纪录
 /// </summary>
 private static void InsertNews()
 {
     if (_news != null && _news.Content != null && _news.Content.Trim() != "")
     {
         if (_news.Title == null || _news.Title == "")
         {
             Console.WriteLine(string.Format("{0}-->获取不到标题", _news.Url));
         }
         if (_news.Content == null || _news.Content.Trim() == "")
         {
             Console.WriteLine(string.Format("{0}-->获取不到内容", _news.Url));
         }
         if (_news.Forum == null || _news.Forum.Trim() == "")
         {
             Console.WriteLine(string.Format("{0}-->获取不到板块", _news.Url));
         }
         if (_news.Time == null || _news.Time.Trim() == "")
         {
             Console.WriteLine(string.Format("{0}-->获取不到时间", _news.Url));
         }
         MysqlHelper mysqlHelper = new MysqlHelper();
         mysqlHelper.InsertNews(_news);
     }
 }
Exemple #4
0
        /// <summary>
        /// 更新新闻纪录的插入时间
        /// </summary>
        /// <param name="newUri"></param>
        private void UpdateUri(MyUri newUri)
        {
            MysqlHelper mysqlHelper = new MysqlHelper();

            mysqlHelper.UpdateInsertTime(newUri.AbsoluteUri);
        }
Exemple #5
0
        internal static void DelAllVisited()
        {
            MysqlHelper helper = new MysqlHelper();

            helper.Del_All_Visited();
        }
Exemple #6
0
        public static bool IsVisited(MyUri uri)
        {
            MysqlHelper helper = new MysqlHelper();

            return(helper.IsVisited(uri));
        }