Click to See Complete Forum and Search --> : Entering String


nkagi
August 13th, 2008, 01:25 AM
Dear All,

I'm quite new at programming with C#. can someone give me example code that I can use to enable a user to enter string characters via keyboard.

the thing is i have to write a hangman game and the user have to guess the word advanced, by typing it. please give me a clu. I am desparate

MNovy
August 13th, 2008, 01:36 AM
you did not say if this is a Console App or WinForm.

Console:
string line;
line = Console.ReadLine();


Win (just use a TextBox):
User can type in text and you can get the text by e.g. "textBox1.text"

nkagi
August 13th, 2008, 03:27 AM
you did not say if this is a Console App or WinForm.

Console:
string line;
line = Console.ReadLine();


Win (just use a TextBox):
User can type in text and you can get the text by e.g. "textBox1.text"


Please see the attached file, how do incoporate the classes to see the string on screen