using System; namespace Example61 { /// /// Summary description for Class1. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { int playerNumber = 0; bool isGoodNumber = false; while (!isGoodNumber) { try { Console.Write("Enter player's number: "); playerNumber = int.Parse(Console.ReadLine()); isGoodNumber = true; } catch (FormatException e) { Console.WriteLine("You must enter an integer " + "for the player number\n\n" + e); } } Console.WriteLine("Player number= " + playerNumber); } } }