简体   繁体   中英

C# automation application

I would like to create an auto email distributor application by C# for my company. Usually, I would create a console application and set up a schedule to run this program from server task scheduler. Is there any ways to build this kind of application other than console application? And what is the benefit of it compared to console application.

It can be done with every application type. Asp.net\\Silverlight\\WCF\\WPF\\WinForm...

Console Application is the easiest way because

  • It doesn't have a UI layer(or almost doesn't have...).
  • No configurations are required.

If you have a robust scheduling application (such as task scheduler), there is little point to rebuilding this inside your application. If the scheduling application is not sufficient for your needs, you'll need to embed that logic in your app.

Either way, a console application is fine. The latter scenario will just require more configuration (in the form of a configuration file probably). Still no need for a UI unless the config is complex.

You may write a Service. Writing a Service in .Net is too easy and straight forward and then you need to use a timer to invoke the operation on schedules.

A service will be executed in the background and can be configured to be executed as soon as the computer turns on.

Because services do not have user interface, you need to feed them with the requests using a database or a messaging system.

Windows schedule of a console application is ok.

If your schedule is continuous (every minute) you might be better off a Windows service see Here .

See this stackoverflow question for the comparison HERE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM