2019-03-22

2019-03-22  本文已影响0人  風立_6719
 //获取专题新闻
        private void GetSubNews(string dateTimeStr)
        {
            base.BeginInvoke(this.logInvoke, new object[] { "【专题新闻】开始更新" });
            this.AddUrlNews();
            string str = ConfigurationManager.AppSettings["sCount"];
            if (string.IsNullOrEmpty(str))
            {
                base.BeginInvoke(this.logInvoke, new object[] { "配置文件错误 , 找不到sCount字段" });
            }
            else
            {
                int num = Convert.ToInt32(str);
                for (int i = 1; i <= num; i++)
                {
                    string[] strArray = ConfigurationManager.AppSettings[$"s{i}"].Split(new char[] { '@' });
                    if (strArray.Length != 2)
                    {
                        base.BeginInvoke(this.logInvoke, new object[] { "配置文件 " + i + "字段格式错误 " });
                        return;
                    }
                    string cName = strArray[0];
                    string str4 = strArray[1];
                    if (string.IsNullOrEmpty(str4))
                    {
                        base.BeginInvoke(this.logInvoke, new object[] { "配置文件错误 , 找不到s" + i + "字段" });
                        return;
                    }
                    if (!this.DoDownload(dateTimeStr, i.ToString(CultureInfo.InvariantCulture), cName, str4, "Sub"))
                    {
                        base.BeginInvoke(this.logInvoke, new object[] { "【专题新闻】更新异常" });
                        return;
                    }
                    Thread.Sleep(500);
                }
                base.BeginInvoke(this.logInvoke, new object[] { "【专题新闻】更新完成" });
            }
        }
上一篇下一篇

猜你喜欢

热点阅读