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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Aug 19, 2009, 6:49 AM
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 :)
Vandana SardanaPosted Sep 16, 2009, 8:25 AM
Vandana SardanaPosted Aug 19, 2009, 6:16 AM
Kirtan PatelPosted Aug 18, 2009, 12:40 PM
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();
}
}
Niradhip ChakrabortyPosted Aug 18, 2009, 8:23 AM
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");
}