Hey, this may sound nooby, I'd like to know how to correctly manipulate Console.ReadLine(); .
If I use this, I have to retype the cases 3 times (Until the third line) for it to take effect.. Here's an image for example.Code:switch (Console.ReadLine()) { case"server": Chat_Server.SimpleServer.Function(); Console.Title = "Server"; Console.ReadLine(); break; case"client": Chat_Server.Client.ClientConnect(); Console.Title = "Client"; Console.ReadLine(); break; }
Here's the whole script
Any ideas? :SCode:Console.ForegroundColor = ConsoleColor.Green; Console.Write("[MENU]"); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("What kind of user are you?\n\n\n \n 1-Type ''Server'' if you wish to start a server. \n 2- Type ''Client'' if you wish to connect to a server."); Console.ReadLine(); Console.ReadLine().ToLower(); switch (Console.ReadLine()) { case"server": Chat_Server.SimpleServer.Function(); Console.Title = "Server"; Console.ReadLine(); break; case"client": Chat_Server.Client.ClientConnect(); Console.Title = "Client"; Console.ReadLine(); break; }




Reply With Quote