About 39,300,000 results
Open links in new tab
  1. C# User Input - W3Schools

    Get User Input. You have already learned that Console.WriteLine() is used to output (print) values. Now we will use Console.ReadLine() to get user input. In the following example, the user can input his or hers username, which is stored in the …

  2. c# - How can I read user input from the console? - Stack Overflow

    a = Console.Read(); This will only read one character from your Console. You can change your program to this. To make it more robust, accept more than 1 char input, and validate that the input is actually a number:

  3. c# - Reading an integer from user input - Stack Overflow

    To your question: You will not find a solution to read an integer because ReadLine() reads the whole command line, threfor returns a string. What you can do is, try to convert this input into and int16/32/64 variable. There are several methods for this:

  4. Different Methods to Read a Character in C# - GeeksforGeeks

    May 26, 2020 · Console.Read() Method is used to read the next character from the standard input stream. This method basically blocks its return when the user types some input characters. As soon as the user press ENTER key it terminates. Syntax: public static int Read (); Return Value: It returns the next characte

  5. How do I receive and store data input in C#? - Stack Overflow

    Dec 19, 2015 · string input = Console.ReadLine(); that will return you a string of the user's input. Check out MSDN for documentation on the Console class. Also look at the Convert class. int num = Convert.ToInt32(input); Good luck new coder.

  6. Get User Input in C# with Console.ReadLine() - C# Tutorials Blog

    Mar 15, 2019 · In this tutorial, we learned how we can use the Console.ReadLine() method to capture a user's input. We learned how to save those values as String variables in order to retrieve them later in our program.

  7. C# User Input | CodeGuru.com

    Oct 4, 2022 · The simplest method to get input from a user in C# is to use one of these three methods: ReadLine(), ReadKey(), or Read(). They are all contained in the Console class and can be called directly with their class name, as they all are static methods.

  8. How to Take User Input in C# - webdevtutor.net

    Aug 7, 2024 · In this blog post, we will explore various methods to take user input in C#. The Console.ReadLine() method is the simplest way to read user input from the console. Here's an example: string name = Console.ReadLine(); Console.WriteLine($"Hello, {name}!");

  9. Read Input from Console in C# - Online Tutorials Library

    Learn how to read input from the console in C# with this comprehensive guide, including examples and best practices.

  10. C#Read User Input through Console - Tutorial Kart

    In C#, you can read input from user through console using Console.ReadLine() function. Console.ReadLine() reads the input entered by user until enter is pressed, and the value is returned.

Refresh