如何使用c#设置特定时序 [英] How to set specific timing using c#
本文介绍了如何使用c#设置特定时序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个应用程序,我想在每个星期六晚上7点将一个文件邮寄给用户
iam搜索如此多的代码,但没有找到我写的找到星期六查找代码,但不能设置具体的时间所以请专家帮助我在这里我粘贴只找到一天是星期六
DateTime dt = new DateTime();
if (dt.DayOfWeek == DayOfWeek.Saturday)
{
}
解决方案
如果您要检查当前日期时间,则需要使用Now属性。
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
{
// 发送邮件
}
最简单的方法是设置一个Windows计划任务。
使用CLR和MSSQL SSIS服务可以在星期六7点钟发送邮件。您可以安排该处理时间。我会尽快发布解决方案。
ello friends,
iam creating one application that i want to mail one file to user at every saturday at 7.00pm
iam searching so much code but not find exactly i wrote find saturday find code but cant set specific timing so please expert help me out here im paste only finding day that is saturday
DateTime dt=new DateTime ();
if (dt.DayOfWeek == DayOfWeek.Saturday)
{
}
解决方案
If you are trying to check the current date time you will need to use the Now property.
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday) { // Send Mail }
The simplest way is to set a Windows Scheduled Task.
Using CLR and MSSQL SSIS Service its Possible to Send mail on Saturday 7o clock. You can schedule that Process time. I will post the solution soon.
这篇关于如何使用c#设置特定时序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文