ipro_ultra
ipro_ultra

Reputation: 160

Wanting a key press to be read automatically by console

I have the following code, What I want to do is for the console to read the key-press and store this in a variable, like a Console.ReadLine but without the need to press Enter at the end of the line.

Dim Player As charStats
    Console.WriteLine("In order to create your character, You must first choose a name for your Character")
    Console.WriteLine("Is your character Male or Female? (M/F)")
    Dim mOrF As String = Console.ReadLine().ToLower

Upvotes: 0

Views: 136

Answers (1)

Binary Worrier
Binary Worrier

Reputation: 51729

At a guess Console.ReadKey() is what you want.

http://msdn.microsoft.com/en-us/library/system.console.readkey(v=vs.110).aspx

Upvotes: 1

Related Questions