Answer the question
In order to leave comments, you need to log in
Windows Service or Application?
There is a task: the program must perform some action according to the established schedule.
There was a choice before me. Implement it as a Service or Application. Additionally, it will be necessary to make it possible to perform some settings (for example, a graph). You also need to notify the user about the operations performed.
Please advise what would be the best way to proceed in this case?
Answer the question
In order to leave comments, you need to log in
It depends on the details. In particular, whether this action should be performed even if no user is logged in, or is it meaningless outside the user's context. If the first - then the service is generally better, however, additional efforts are needed to install it into the system, and, more importantly, you should not try to create windows from the service and generally interact with the UI - this is possible, but difficult and requires additional work. troubles. Therefore:
a) think about whether your application performs some kind of global task that does not depend on the user (a la defragmentation or, there, archiving). If yes, then:
b) evaluate whether it is possible to break your application into: the actual service that will perform a useful task; control panel - a regular desktop application that will interact with the service and change its settings and state;
c) assess whether you have the resources (time / money) to deal with additional subtleties (installing and running the service, features of writing the service (in the sharp you need to inherit from the library class), interaction between the UI control and the service);
d) if points a, b, c are true, then do it in accordance with them, if at least one is false, make a better desktop application.
In general, services are normally written on Sharp, I tried it, you can figure it out in a couple of days, including the simplest installation scripts.
Write a console application and run it through AT or scheduler.
If you feel like it, you can issue the console as a service using SrvAny.exe or rewrite it as a service.
The usual application, IMHO: there will be less trouble with both writing and launching.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question