Schedule task in ASP.NET

前端 未结 2 513
野性不改
野性不改 2020-12-07 04:43

I\'m trying to create a task scheduler that runs twice a day. I\'ve implemented a task scheduler using CacheItemRemovedCallaback, as suggested in this post and this blog. I

2条回答
  •  粉色の甜心
    2020-12-07 05:39

    Using hacks like Windows Scheduled Tasks and Control Panel abilities are not nice solutions. They sucks most of the time, they are a headache.

    You can use ATrigger scheduling service. A .Net library is also available to create scheduled tasks without overhead.

    //Tags: Tags are required to identify tasks. 
    //read more at: http://atrigger.com/docs/wiki/9/rest-api-v10-parameter-tag_
    Dictionary tags = new Dictionary();
    tags.Add("type", "test");
    
    //Create
    ATrigger.Client.doCreate(TimeQuantity.Hour(), "12", "http://www.example.com/myTask?something", tags);
    

    Disclaimer: I was among the ATrigger team. It's a freeware and I have not any commercial purpose.

提交回复
热议问题