animedragonfighter
the-computer-wizard.tripod.com
@the_comp_wiz
| Forum | Thread | Replies | Latest activity |
|---|---|---|---|
| Tech Off | More info for the user account model in MVC3 | 1 | Jun 19, 2012 at 3:14 PM |
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
| Forum | Thread | Replies | Latest activity |
|---|---|---|---|
| Tech Off | More info for the user account model in MVC3 | 1 | Jun 19, 2012 at 3:14 PM |
Working with DateTime - 13
Jan 05, 2012 at 1:51 PMI had fun working with DateTime, I even created a console app that tells my grandfather happy birthday, how many days to wait until it tells him happy birthday, and even when his birthday pass, it will tell him to delete the file. This was a whole lot more fun and better then making a card or sending an eCard.
Here is the code I used.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) /* If you want to use this file to tell someone happy birthday, * all you must do is change the "OPEN THIS...", the birthDay value, * and the names, telling who's birthday it is and who it is from. */ { // The Information at the top of the Console Console.WriteLine("O P E N T H I S P R O G R A M 2 0 1 2"); Console.WriteLine("==========================================="); //The Variables and Data Types DateTime rightNow = DateTime.Now.Date; DateTime birthDay = DateTime.Parse("01/28/2012"); TimeSpan daysLeft = birthDay.Subtract(DateTime.Now); //If Today is his birthday if (rightNow == birthDay) { Console.WriteLine("Happy Birthday Papa!\n \n From: name"); Console.WriteLine("======================================"); Console.ReadLine(); } // If his bithday has already passed else if (rightNow > birthDay) { Console.WriteLine("Sorry, but this program is valid for this year only. This program is no longer of any use, you may delete it."); Console.ReadLine(); } //If his birthday hasn't quite made it here yet else { Console.WriteLine("Sorry, but you must wait " + daysLeft.Days + " days, then open this file. \n"); Console.WriteLine("It is currently: " + DateTime.Now); Console.ReadLine(); } } } }