Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
 DateTime dt=new DateTime ();
if (dt.DayOfWeek == DayOfWeek.Saturday)
{
}
Posted
Updated 18-Jan-13 5:36am
v2

If you are trying to check the current date time you will need to use the Now property.
C#
if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
{
    // Send Mail

}
 
Share this answer
 
v2
Comments
Atul Rokade 18-Jan-13 9:39am    
BC@CV sir im not checking current datetime actually im only check saturday and if i find saturday then check set time hope u geting my question
BC @ CV 18-Jan-13 9:47am    
Well, actually I don't get your question. If you are not checking to see if the current time is Saturday at 7pm what are you checking?
Atul Rokade 18-Jan-13 10:17am    
sorry BC@CV im not getting your point early bt now concept is clear ur code work fine thank you
Sergey Alexandrovich Kryukov 18-Jan-13 19:44pm    
I wonder, what kind of idiot down-voted this answer? As it is correct, and also because it was difficult to understand OP (who is totally lost), I voted 5.
—SA
BC @ CV 23-Jan-13 10:54am    
Thanks SA. I was wondering the same thing.
The simplest way is to set a Windows Scheduled Task.
 
Share this answer
 
Comments
Atul Rokade 18-Jan-13 9:57am    
piebaldconsult--> how can use 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.
 
Share this answer
 

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