//获取常规新闻
private void GetNromalNews(string dateTimeStr)
{
base.BeginInvoke(this.logInvoke, new object[] { "【常规新闻】开始更新" });
string str = ConfigurationManager.AppSettings["nCount"];
if (string.IsNullOrEmpty(str))
{
base.BeginInvoke(this.logInvoke, new object[] { "配置文件错误 , 找不到nCount字段" });
}
else
{
int num = Convert.ToInt32(str);
for (int i = 1; i <= num; i++)
{
string[] strArray = ConfigurationManager.AppSettings[$"n{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[] { "配置文件错误 , 找不到n" + i + "字段" });
return;
}
if (!this.DoDownload(dateTimeStr, i.ToString(CultureInfo.InvariantCulture), cName, str4, "Normal"))
{
base.BeginInvoke(this.logInvoke, new object[] { "【常规新闻】更新异常" });
return;
}
Thread.Sleep(500);
}
base.BeginInvoke(this.logInvoke, new object[] { "【常规新闻】更新完成" });
}
}
网友评论