亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

ncrontab - Crontab for .NET - Google Project

系統 2135 0

ncrontab - Crontab for .NET - Google Project Hosting

A library written in C# 3.0 that provides the following facilities:

  • Parsing of crontab expressions
  • Formatting of crontab expressions
  • Calculation of occurrences of time based on a crontab schedule

This library does not provide any scheduler or is not a scheduling facility like cron from Unix platforms. What it provides is parsing, formatting and an algorithm to produce occurrences of time based on a give schedule expressed in the crontab format:

      
        *
      
      
      
      
        *
      
      
      
      
        *
      
      
      
      
        *
      
      
      
      
        *
      
      
        
- - - - -
| | | | |
| | | | +----- day of week ( 0 - 6 ) ( Sunday = 0 )
| | | +------- month ( 1 - 12 )
| | +--------- day of month ( 1 - 31 )
| +----------- hour ( 0 - 23 )
+------------- min ( 0 - 59 )

Star ( * ) in the value field above means all legal values as in parentheses for that column. The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range). For more, see CrontabExpression .

Below is an example in IronPython of how to use CrontabSchedule class from NCrontab to generate occurrences of the schedule 0 12 * */2 Mon (meaning, 12:00 PM on Monday of every other month, starting with January ) throughout the year 2000:

      
        IronPython
      
      
      
      
        1.1
      
      
      
      
        (
      
      
        1.1
      
      
        )
      
      
         on 
      
      
        .
      
      
        NET 
      
      
        2.0
      
      
        .
      
      
        50727.1434
      
      
        
Copyright ( c ) Microsoft Corporation . All rights reserved .
>>> import clr
>>> clr . AddReferenceToFileAndPath ( r 'C:\NCrontab\bin\Release\NCrontab.dll' )
>>> from System import DateTime
>>> from NCrontab import CrontabSchedule
>>> s = CrontabSchedule . Parse ( '0 12 * */2 Mon' )
>>> start = DateTime ( 2000 , 1 , 1 )
>>> end = start . AddYears ( 1 )
>>> occurrences = s . GetNextOccurrences ( start , end )
>>> print '\n' . join ([ t . ToString ( 'ddd, dd MMM yyyy hh:mm' ) for t in occurrences ])
Mon , 03 Jan 2000 12 : 00
Mon , 10 Jan 2000 12 : 00
Mon , 17 Jan 2000 12 : 00
Mon , 24 Jan 2000 12 : 00
Mon , 31 Jan 2000 12 : 00
Mon , 06 Mar 2000 12 : 00
Mon , 13 Mar 2000 12 : 00
Mon , 20 Mar 2000 12 : 00
Mon , 27 Mar 2000 12 : 00
Mon , 01 May 2000 12 : 00
Mon , 08 May 2000 12 : 00
Mon , 15 May 2000 12 : 00
Mon , 22 May 2000 12 : 00
Mon , 29 May 2000 12 : 00
Mon , 03 Jul 2000 12 : 00
Mon , 10 Jul 2000 12 : 00
Mon , 17 Jul 2000 12 : 00
Mon , 24 Jul 2000 12 : 00
Mon , 31 Jul 2000 12 : 00
Mon , 04 Sep 2000 12 : 00
Mon , 11 Sep 2000 12 : 00
Mon , 18 Sep 2000 12 : 00
Mon , 25 Sep 2000 12 : 00
Mon , 06 Nov 2000 12 : 00
Mon , 13 Nov 2000 12 : 00
Mon , 20 Nov 2000 12 : 00
Mon , 27 Nov 2000 12 : 00

Below is the same example in F# Interactive ( fsi.exe ):

      
        Microsoft
      
      
      
      
        (
      
      
        R
      
      
        )
      
      
         F
      
      
        # 2.0 Interactive build 4.0.40219.1
      
      
        
Copyright ( c ) Microsoft Corporation . All Rights Reserved .

For help type #help;;

> #r "NCrontab.dll"
-
- open NCrontab
- open System
-
- let schedule = CrontabSchedule . Parse ( "0 12 * */2 Mon" )
- let startDate = DateTime ( 2000 , 1 , 1 )
- let endDate = startDate . AddYears ( 1 )
-
- let occurrences = schedule . GetNextOccurrences ( startDate , endDate )
- occurrences |> Seq . map ( fun t -> t . ToString ( "ddd, dd MMM yyy hh:mm" ))
- ? ? ? ? ? ? |> String . concat "\n"
- ? ? ? ? ? ? |> printfn "%s" ;;

--> Referenced 'C:\NCrontab\bin\Release\NCrontab.dll'

Mon , 03 Jan 2000 12 : 00
Mon , 10 Jan 2000 12 : 00
Mon , 17 Jan 2000 12 : 00
Mon , 24 Jan 2000 12 : 00
Mon , 31 Jan 2000 12 : 00
Mon , 06 Mar 2000 12 : 00
Mon , 13 Mar 2000 12 : 00
Mon , 20 Mar 2000 12 : 00
Mon , 27 Mar 2000 12 : 00
Mon , 01 May 2000 12 : 00
Mon , 08 May 2000 12 : 00
Mon , 15 May 2000 12 : 00
Mon , 22 May 2000 12 : 00
Mon , 29 May 2000 12 : 00
Mon , 03 Jul 2000 12 : 00
Mon , 10 Jul 2000 12 : 00
Mon , 17 Jul 2000 12 : 00
Mon , 24 Jul 2000 12 : 00
Mon , 31 Jul 2000 12 : 00
Mon , 04 Sep 2000 12 : 00
Mon , 11 Sep 2000 12 : 00
Mon , 18 Sep 2000 12 : 00
Mon , 25 Sep 2000 12 : 00
Mon , 06 Nov 2000 12 : 00
Mon , 13 Nov 2000 12 : 00
Mon , 20 Nov 2000 12 : 00
Mon , 27 Nov 2000 12 : 00

val schedule
: NCrontab . CrontabSchedule = 0 12 * 1 , 3 , 5 , 7 , 9 , 11 1
val startDate
: System . DateTime = 1 / 1 / 2000 12 : 00 : 00 AM
val endDate
: System . DateTime = 1 / 1 / 2001 12 : 00 : 00 AM
val occurrences
: seq < System . DateTime >

ncrontab - Crontab for .NET - Google Project Hosting


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产精品第六页 | 国产日本欧美亚洲精品视 | 国产高清一区二区 | 欧美亚洲高清 | 欧美精品成人a多人在线观看 | 国产综合成人亚洲区 | 99精品国产自产在线观看 | 一级毛片日韩a欧美 | 天天射综合 | 日韩在线一区二区三区视频 | 99av视频| 久久99国产精品一区二区 | 欧美大片日韩精品四虎影视 | 高清国产一区二区 | 男人天堂黄色 | 久草网在线观看 | 国产成人一区 | 国产精品久久国产精麻豆99网站 | 国产一毛片 | 999久久狠狠免费精品 | 九九精品热线免费观看6 | 午夜欧美成人 | 手机看一级片 | 亚洲日本中文字幕 | 成人网18免费网站在线 | 亚洲欧洲日产国码天堂 | 亚洲一区综合在线播放 | 国产男女猛视频在线观看网站 | 青青青国产免费手机视频在线观看 | 欧美日韩国产精品综合 | 成人网中文字幕色 | 日韩免费中文字幕 | 日日操干| 综合另类小说色区色噜噜 | 日本不卡免费新一区二区三区 | 中文字幕一区二区精品区 | 欧美一级毛片免费看视频 | 欧美日韩国产一区二区三区欧 | 日韩a免费 | 一级作爱视频免费观看 | 波多野结衣视频一区 |