I made a console application that calculates the number of days since a user-specified date. But after the original calculation, if another date is typed in, the application closes.
Is there a way I can get my application to not close if the user wants to continue using it?
Console.WriteLine("Please enter the date you wish to specify: (DD/MM/YYYY)");
string userInput;
userInput = Console.ReadLine();
DateTime calc = DateTime.Parse(userInput);
TimeSpan days = DateTime.Now.Subtract(calc);
Console.WriteLine(days.TotalDays);
Console.ReadLine();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…