This article is a mirror article of machine translation, please click here to jump to the original article.

View: 45521|Reply: 2

[Console Program] A Windows task scheduler that executes tasks at regular intervals in C#

[Copy link]
Posted on 4/13/2019 9:54:33 PM | | | |

preface
In the previous topic, the database creation job plan is recorded to realize the scheduled execution of tasks. This article will record the use of Windows task scheduler to implement the function of sending emails at regular intervals.

environment

>Windows 10 system


tools

>VS 2015


Text

step1: Open VS2015, create a console application, write the code to be executed in the Main function, and F6 to generate the .exe file.



Note: The sender authentication credentials above are not the password for the email address. It is a verification certificate, which can be searched online.

Step2: Open Run and enter "taskschd.msc" - > OK.



Step3: In the opening Task Scheduler dialog box, right-click Task Scheduler Library – > select Create Task.




Step4: In the popping up "Create Task" window, in the "General" tab, fill in the name, description, and security options.




step5: In the "Trigger" tab, click "New", and in the pop-up "New Trigger" window, set the execution time - "OK".







step6: In the "Actions" tab, click "New", in the pop-up "New Action" window, under the settings "Program or Script" select the .exe file we just generated in VS - "OK".






step7: In the "Conditions" tab, remove some tick options.



Step8: In the "Settings" tab, make the relevant settings - > confirm.



Okay, so we have a simple timed email function.

Epilogue

It's just that the demo is very rough. Send emails, and you can also set CC by, attachments, etc. The next topic will continue to record scheduled execution tasks.









Previous:Visual Studio 2019 Enterprise Edition offline installation tutorial
Next:Yijin University Android Reverse Video Tutorial
Posted on 4/15/2019 9:43:09 AM |
Very useful, and I do a mysql scheduled backup principle

Use MySQL to automatically schedule backups in a Windows environment
https://www.itsvse.com/thread-7412-1-1.html
(Source: Architect_Programmer)
Posted on 11/10/2021 1:11:40 PM |
Learn how to achieve it as a landlord
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com