Quartz.NET定时任务,可直接生成Windows服务


采用Quartz.NET开源作业调度框架,实现简单的定时任务。 配合Topshelf.NET,直接安装Windows服务。
资源截图
代码片段和文件信息
using System.Collections.Specialized;
using System.Configuration;

namespace QuartzTH
{
/// 
/// Configuration for the Quartz server.
/// 

public class Configuration
{
private const string PrefixServerConfiguration = “quartz.server“;
private const string KeyServiceName = PrefixServerConfiguration + “.serviceName“;
private const string KeyServiceDisplayName = PrefixServerConfiguration + “.serviceDisplayName“;
private const string KeyServiceDescription = PrefixServerConfiguration + “.serviceDescription“;
        private const string KeyServerImplementationType = PrefixServerConfiguration + “.type“;

private const string DefaultServiceName = “THServer“;
private const string DefaultServiceDisplayName = “TH Server“;
private const string DefaultServiceDescription = “TH‘s Quartz Job Scheduling Server“;
    private static readonly string DefaultServerImplementationType = typeof(THServer).AssemblyQualifiedName;

    private static readonly NameValueCollection configuration;

        /// 
        /// Initializes the  class.
        /// 

static Configuration()
{
configuration = (NameValueCollection) ConfigurationManager.GetSection(“quartz“);
}

        /// 
        /// Gets the name of the service.
        /// 

        /// The name of the service.
public static string ServiceName
{
get { return GetConfigurationOrDefault(KeyServiceName DefaultServiceName); }
}

        /// 
        /// Gets the display name of the service.
        /// 

        /// The display name of the service.
public static string ServiceDisplayName
{
get { return GetConfigurationOrDefault(KeyServiceDisplayName DefaultServiceDisplayName); }
}

        /// 
        /// Gets the service description.
        /// 

        /// The service description.
public static string ServiceDescription
{
get { return GetConfigurationOrDefault(KeyServiceDescription DefaultServiceDescription); }
}

        /// 
        /// Gets the type name of the server implementation.
        /// 

        /// The type of the server implementation.
    public static string ServerImplementationType
    {
            get { return GetConfigurationOrDefault(KeyServerImplementationType DefaultServerImplementationType); }
    }

/// 
/// Returns configuration value with given key. If configuration
/// for the does not exists return the default value.
/// 

/// Key to read configuration with.
/// Default value to return if configuration is not found
/// The configuration value.
private static string GetConfigurationOrDefault(string configurationKey string defaultValue

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.    101888  2015-11-12 10:52  QuartJobAppQuartJobApp.vsQuartJobAppv14.suo

     文件     135574  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0Common.Logging.3.3.0.nupkg

     文件      44544  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et35Common.Logging.dll

     文件     153088  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et35Common.Logging.pdb

     文件     167814  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et35Common.Logging.xml

     文件      44544  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et40Common.Logging.dll

     文件     169472  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et40Common.Logging.pdb

     文件     167494  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.3.3.0lib
et40Common.Logging.xml

     文件      32121  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0Common.Logging.Core.3.3.0.nupkg

     文件       9728  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et35Common.Logging.Core.dll

     文件      11776  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et35Common.Logging.Core.pdb

     文件      54432  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et35Common.Logging.Core.xml

     文件      10240  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et40Common.Logging.Core.dll

     文件      11776  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et40Common.Logging.Core.pdb

     文件      54432  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0lib
et40Common.Logging.Core.xml

     文件      10240  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0libportable-win+net40+sl40+wp7Common.Logging.Core.dll

     文件      11776  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0libportable-win+net40+sl40+wp7Common.Logging.Core.pdb

     文件      54432  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Core.3.3.0libportable-win+net40+sl40+wp7Common.Logging.Core.xml

     文件      37586  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0Common.Logging.Log4Net1211.3.3.0.nupkg

     文件      15360  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et35Common.Logging.Log4Net1211.dll

     文件      38400  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et35Common.Logging.Log4Net1211.pdb

     文件      17250  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et35Common.Logging.Log4Net1211.xml

     文件      15360  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et40Common.Logging.Log4Net1211.dll

     文件      42496  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et40Common.Logging.Log4Net1211.pdb

     文件      17250  2015-10-15 16:14  QuartJobAppQuartJobApppackagesCommon.Logging.Log4Net1211.3.3.0lib
et40Common.Logging.Log4Net1211.xml

     文件     299008  2015-10-15 16:13  QuartJobAppQuartJobApppackageslog4net.2.0.3lib
et10-fulllog4net.dll

     文件    1432719  2015-10-15 16:13  QuartJobAppQuartJobApppackageslog4net.2.0.3lib
et10-fulllog4net.xml

     文件     299008  2015-10-15 16:13  QuartJobAppQuartJobApppackageslog4net.2.0.3lib
et11-fulllog4net.dll

     文件    1433870  2015-10-15 16:13  QuartJobAppQuartJobApppackageslog4net.2.0.3lib
et11-fulllog4net.xml

     文件     303104  2015-10-15 16:13  QuartJobAppQuartJobApppackageslog4net.2.0.3lib
et20-fulllog4net.dll

............此处省略108个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)