Quartz.net创建windows服务

序言

安装服务

sc create XXService binpath= "XXService.exe"  start= auto
sc description XXService "XX服务" 
sc start XXService
pause

卸载服务

sc stop XXService
sc delete XXService
pause

 

复制代码
<?xml version="1.0" encoding="UTF-8"?>

 

<!-- This file contains job definitions in schema version 2.0 format -->

<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">

 

  <processing-directives>

    <overwrite-existing-data>true</overwrite-existing-data>

  </processing-directives>

 

  <schedule>

    <!--该作业用于定时更新商品库存-->

    <job>

      <name>UpdateInventoryJob</name>

      <group>Update</group>

      <description>定时更新商品库存</description>

      <job-type>TopshelfAndQuartz.UpdateInventoryJob,TopshelfAndQuartz</job-type>

      <durable>true</durable>

      <recover>false</recover>

    </job>

    <trigger>

      <cron>

        <name>UpdateInventoryTrigger</name>

        <group>Update</group>

        <job-name>UpdateInventoryJob</job-name>

        <job-group>Update</job-group>

        <start-time>2017-12-01T00:00:00+08:00</start-time>

        <cron-expression>0 0/1 * * * ?</cron-expression>

      </cron>

    </trigger>

  </schedule>

 

</job-scheduling-data>
复制代码

 

 

 

资料

Quartz.NET 配置文件详解

https://www.cnblogs.com/asxinyu/p/dotnet_Opensource_project_CronNET.html

https://www.cnblogs.com/jsenke/p/5545635.html

https://www.cnblogs.com/qk2014/p/4869675.html

posted @   ~沐风  阅读(488)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示