如何在C#中制作提醒应用程序 [英] How to make a reminder application in C#

查看:90
本文介绍了如何在C#中制作提醒应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个提醒应用程序,在设定的时间提醒我的消息。当设定时间接近系统时间时,我的提醒信息显示有警报音。可能它完成SQL Server 2012数据库

请给我任何想法我该怎么做。



先谢谢。



我尝试了什么:



我没有代码也不知道怎么可以我这样做

I want to make a reminder application which remind my message on the set time. when the set time approach the system time my reminder message display with alarm tune. may it complete with SQL server 2012 database
please give me any idea how can i do this.

Thanks in Advance.

What I have tried:

I have no code and no idea how can i do this

推荐答案

你要做的第一件事就是意识到除非你的应用程序正在运行,否则你的提醒将不会显示:所以你需要决定你的应用程序是否正确应该一直运行,或者由操作系统定期启动以检查并显示是否需要。这两种方法非常不同,需要预先设置不同的代码。



除此之外,它非常简单:在数据库中存储提醒列表(因此它们会持续一次计算机已关闭)并在应用程序启动时将其读回。

如果您的应用程序偶尔运行,请抽出时间,查看列表,显示任何准备就绪提醒并将其从DB。

如果你的应用程序一直运行,设置一个Timer,并处理它的Tick事件。在Tick处理程序中,执行与偶尔应用程序相同的操作。



首先编写代码来访问数据库,比较列表,然后显示消息。

然后从一个方向或另一个方向展开。
The first thing you have to do is realise that your reminders won't display unless your app is running: so you need to decide if your app should be running all the time, or kicked off at regular intervals by the operation system to check and display if it needs to. The two approaches are very different, and need preety different code.

Other than that, it's pretty simple: store a list of reminders in your database (so they persist once the computer is switched off) and read them back when your app starts.
If your app is running occasionally, get the time, check your list, display any "ready to go" reminders and remove them from the DB.
If you app runs all the time, set up a Timer, and handle it's Tick event. In the Tick handler, do the same as you did for an "occasional" app.

So start by writing code to access your DB, compare lists, and then display messages.
Then expand from that in one direction or the other.


您需要一个调度程序。这可以通过Quartz.Net完成,位于:



1. Quartz Enterprise Scheduler .NET | Quartz.NET文档 [ ^ ]

2. GitHub - quartznet / quartznet:Quartz Enterprise Scheduler .NET [ ^ ]
You need a scheduler. This can be done with Quartz.Net, located here:

1. Quartz Enterprise Scheduler .NET | Quartz.NET Documentation[^]
2. GitHub - quartznet/quartznet: Quartz Enterprise Scheduler .NET[^]


这篇关于如何在C#中制作提醒应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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