如何使用C#在ADO.NET Window应用程序中设置每个月的提醒警报时间 [英] How to set time for reminder alert on every month in ADO.NET Window Application with C#

查看:69
本文介绍了如何使用C#在ADO.NET Window应用程序中设置每个月的提醒警报时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

任何人都可以告诉我如何使用C#在ADO.NET窗口应用程序中为每个月设置提醒警报的时间.我遇到了这个问题

谢谢

hello

anyone can tell me How to set time for reminder alert on every month in ADO.NET Window Application with C#. i stuck this problem

Thanks

推荐答案

如果您的应用程序知道您要在每月的哪一天显示警报,而您的应用程序是每天将要启动和停止的警报,则只需检查一下每月的哪一天到您希望在每次启动应用程序时发出警报的日期.如果其大于或等于您想要的日期,请显示警报.

但是,如果您的程序将启动,然后在数月内没有停止,则您必须编程为其中一个程序更新方法,其中某些代码会检查月份中的某天,并执行与上述相同的操作.另一种方法是使用计时器,但是这些计时器往往会使用很短的毫秒级时间.将一个月设置为毫秒似乎有点荒谬...:P
If your application knows what day of the month you want the alert to show on and your application is one where it will be started and stopped daily then simply check what day of the month it is to what day you wanted the alert every time the application is started. If its greater than or equal to the day you wanted, show the alert.

If however, your program will be started and then not stopped for months you would have to program into say one of you programs update methods some code that checks the day of the month and do the same as above. An alternative method is to use a timer but those tend to be used for short, few millisecond periods of time. Setting one month in milliseconds seems a little ridiculous... :P


以前我无法理解您要询问的内容,但经过深思熟虑,听起来您需要 Windows服务!

样本:
发送自动电子邮件警报的简单Windows服务 [ Windows服务应用程序简介 [简单Windows服务示例 [您的第一个C#Web服务 [ Windows Services in Action I [
Earlier I could not get what you tried to ask but on second thought, it sounds like you are in a need of Windows Service!

Sample:
Simple Windows Service which sends auto Email alerts[^]

MSDN: Details about Windows Service:
Introduction to Windows Service Applications[^]

For more details, look here:
Simple Windows Service Sample[^]
Your first C# Web Service[^]
Windows Services in Action I[^]


这篇关于如何使用C#在ADO.NET Window应用程序中设置每个月的提醒警报时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆