public static void RunSiteTask()
{
int intSend = 360;
System.Timers.Timer t = new System.Timers.Timer(1000 * intSend);//每1小时更新一个
t.Elapsed += new System.Timers.ElapsedEventHandler(RunUpdateSearchAdsImgTime);
t.AutoReset = true;
t.Enabled = true;
GC.KeepAlive(t);
}
private static void RunUpdateSearchAdsImgTime(object sender, System.Timers.ElapsedEventArgs e)
{
if (SqlHelper.UpInfo_int("ThreadingUpAdsImgSearchTime", null) <= 0)
{
string strErrorMessage = string.Empty;
string strPage = string.Empty;
string strIP =string.Empty;
// 在出现未处理的错误时运行的代码----通常只处理该异常就好
strPage = "服务器执行事件";
strIP = "服务器";
strErrorMessage = "站点定时更新关键字广告表的搜索时间失败。注:有可能当前还没有任何订购关键字广告服务。";
GlobalDataDAL.RecordSysLog(strPage, strErrorMessage, strIP, 2);
}
}