Answer the question
In order to leave comments, you need to log in
Why is an exception thrown in mono?
I'm starting to learn C #, there is such a piece of code. When entering the correct string in Windows, everything is fine, but when I run it through mono under the line, a System.FormatException is thrown.
I enter the same line ("January 15, 1995")
while (true)
{
Console.WriteLine("Введите дату рождения:");
try
{
birthday = Convert.ToDateTime(Console.ReadLine());
break;
}
catch (System.FormatException)
{
Continue.WrongInput();
}
}
Answer the question
In order to leave comments, you need to log in
Perhaps you have a different date format configured in the line or a different region is selected.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question