char typeClient = ' ';
bool clientValide = false;
while (!clientValide)
{
Console.WriteLine("\nEntrez le type d'employé (c ou g) : ");
clientValide = char.TryParse(Console.ReadLine(), out typeClient);
if (clientValide)
typeClient = 'c';
}
:)C# TryParse 동안 while char 'g'또는 'c'가 아니면도움을 요청할 때 잠시 중단하지 않으려 고합니다. TryParse
주변을 먼길하려고하는 것처럼 보입니다. ''c "'와'"g "'문자열에 대해 들어오는 문자열의 유효성을 검사하십시오 (대소 문자를 구분하지 않으려면 ToLower()를 사용하십시오). – Oded