private void MainForm_Load(object sender, EventArgs e)
{
string str = ConfigurationManager.AppSettings["DBStr"];
if (string.IsNullOrEmpty(str))
{
base.BeginInvoke(this.logInvoke, new object[] { "无法读取数据库连接字符串,请检查配置文件是否丢失或异常,修改配置文件异常后请重启软件。" });
this.button_Do.Enabled = false;
this.button_CleanAll.Enabled = false;
this.groupBox2.Enabled = false;
this.groupBox3.Enabled = false;
}
else
{
base.BeginInvoke(this.logInvoke, new object[] { "新闻解析工具启动" });
SqlHelper.DBString = str;
base.BeginInvoke(this.logInvoke, new object[] { "当前数据库连接为: " + str });
base.BeginInvoke(this.logInvoke, new object[] { "3 秒后首次运行程序..." });
this._nextWorkTime = DateTime.Now.AddSeconds(3.0);
this.TimePlan();
}
base.BeginInvoke(this.noteInvoke, new object[] { string.Format("当前下载新闻 {3} 条,解析新闻 {0} 条,专题新闻 {1} 条,常规新闻 {2} 条。", new object[] { this._articleNewsCount + this._subNewsCount, this._subNewsCount, this._articleNewsCount, this._downloadCount }) });
}
网友评论