Is there a library or class to create a scheduled task on Vb.net?

0

Good morning community.

I have a few days to program in VB. In this occasion I find a functionality to develop, which is to carry out a scheduled task.

I've been researching and I can see that implementations can be made or even use system resources for this purpose, but I do not know if these uses will work on windows server, since some only indicate that they are for windows 7 or the dinosaur of XP.

That's why I ask the experts on VB.net for help and to know if there is a library (I am Javero) that can help me in this step, since I would like to optimize this part as much as possible instead of doing my own Job.

Greetings and good day.

    
asked by Green - 4 05.06.2017 в 17:10
source

1 answer

1

You can use Quartz . It is a port of a Java library. I have used it in production in several projects and so far I have done very well. The API is quite friendly too, look at an example that creates a new job to run every day at 6 pm:

    IJobDetail sincronizarJobDetail = JobBuilder
                .Create<SincronizarClasificadoresJob>()
                .WithIdentity(SincronizarKey).Build();
    ITrigger triggerSincronizar = TriggerBuilder.Create()
                .WithDailyTimeIntervalSchedule(
                s =>
                    s.OnEveryDay()
                    .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(18, 0))
                ).Build();

Jobs only need to implement this interface:

  public interface IJob
  {

    void Execute(IJobExecutionContext context);
  }
    
answered by 05.06.2017 / 20:15
source