Pop up window
hi, i want to develop an application which will give pop ups remainder according to the expiry date of the product. i have to compare it with the system date.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 19, 2009, 2:49 AM EDT
Just Yesterday I Posted the Same Kind Of Code On C-sharp corner that sends reminder as mail when 10 days are left
take look at my post here
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=63329
if you don't Understand the code there . i m here to assist you :)
Thanks .
Happy Coding :)
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Aug 18, 2009, 4:23 AM EDT
string strExpiryDateFromDatabase = "12/08/2010";
// I have hardcoded the date here. Please fetch the expiary date from database or xnl file and assign it in strExpiryDateFromDatabase variable.
string strTodaysdate = System.DateTime.Today.ToString("dd/MM/yyyy");
if (Convert.ToDateTime(strTodaysdate) > Convert.ToDateTime(strExpiryDateFromDatabase))
{
MessageBox.Show("Your date is expired");
}
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 18, 2009, 8:40 AM EDT
don't Forget to mark "Do you like Answer" it will give me some credits :)
private void Form1_Load(object sender, EventArgs e)
{
DateTime DateToday = DateTime.Now;
DateTime ExpirationDate = DateTime.Parse("8/21/2009");
if (DateToday <= ExpirationDate)
{
TimeSpan t = ExpirationDate.Subtract(DateToday);
int daysRemaining = t.Days;
MessageBox.Show(daysRemaining.ToString() + " Remaining !!");
}
else
{
MessageBox.Show("Application Expired !!");
Application.Exit();
}
}
Vandana Sardana48 reputationPosted Aug 19, 2009, 2:16 AM EDT
Vandana Sardana48 reputationPosted Sep 16, 2009, 4:25 AM EDT