现在做一个B/S项目需要用到计划任务,本来想自定写一个的,写了几句,突然想看看网上有没有现成可以用的.
结果在苦寻之下找到了Quartz这个组件.看过之后感觉还不错.决定用它实现计划任务了.
再找找看有没有现成的任务.但找了大半天.大多数都是C/S结构中用的.
于是就把自已的写的Demo放到网上,供大家参考一下,如有不正确之 处,还请大家多多指教!
第一步:
引用三个dll文件:Nullables.dll,Quartz.dll,Common.Logging.dll
没有引用Common.Logging.dll出出错.也没多看,大家可以看一下为什么!
第二步:
配置Web.Config文件
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLogger