Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi geeks,
 
I have C# windows application. That application functionality like; when new user registered with mobile number than after successfully registered user will get welcome text message. It will properly but now I want to add functionality like; Every 1st day of month all user will have to get auto message like; "Good Morning".  How it can be done?


What I have tried:

Made google but can't find proper solution.
Posted
Updated 8-Jul-19 19:17pm

1 solution

The easiest way is to write an app that sends the SMSes, and use the Windows Scheduler to run it on the first of each month: How to automate tasks in Windows | TechRadar[^]
 
Share this answer
 
Comments
Member 14519466 9-Jul-19 1:47am    
Hi OriginalGriff,

Thanks for answering.
But I am not get my solution.
I want to go with C# code. Because This Windows Application is for my client. So Client want only application which fulfill his needs not extra setting.


Thanks
OriginalGriff 9-Jul-19 2:11am    
You can't write "c# code" that "runs at a specific time".
You can write C# code that checks if it is a specific time or date while it is running, but unless it is running at the time it will not know. Scheduling when a task should happen is an OS feature, and in Windows the Scheduler allows you to say "run this app at 09:00 on the first of each month" You then write the C# code to actually send the SMS - which I assume you can do, it's not exactly complicated and there are a lot of examples on Google and on this site - and schedule that app to run. That way, the app doesn't need to be running 24 hours a day, 7 days a week, 365 days a year in order to do something 12 times a year. And if your user closes your "full time running app", or it crashes for some reason, your SMSes don't go out at all.
Maciej Los 9-Jul-19 16:03pm    
5ed!
Member 14519466 22-Jul-19 6:42am    
Okay, I understand what you want to say.
I have logic and coding ready but don't know how to execute in windows scheduler.
OriginalGriff 22-Jul-19 6:46am    
https://www.google.com/search?q=windows+scheduler&oq=windows+scheduler&aqs=chrome..69i57j69i59&sourceid=chrome&ie=UTF-8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900