我製作了一個控制檯應用程序,用於計算自用戶指定日期以來的天數。但是在原始計算之後,如果輸入了另一個日期,則應用程序關閉。獲取控制檯應用程序以允許多次輸入
有沒有辦法讓我的應用程序不關閉,如果用戶想繼續使用它?
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();
請張貼您正在使用的代碼,以便我們能夠最好地告訴您如何修改它並解釋您出錯的位置。 – mclark1129
顯示您的代碼! –
道歉,代碼現在在那裏! – RayB151