c# console get user input in variable code example Example: c# console input string userName = Console.ReadLine();