C Sharp - Read a line from the console.?

Alster

New member
Joined
Nov 20, 2008
Messages
3
Reaction score
0
Points
1
So basically what this is supposed to do is read the line the person in putted and if they in putted'hi' the console would say 'hi' back.

It's been a long time since I used C and since I last used it I've been dabbling in Visual Basic. But now I'm re learning C. It's may be a little hard to explain so I've written it out in VB...

----
If textbox1.text = ("hi") Then
textbox2.Text = ("hello thar. I'm the computer")
----

Easy in VB. In C I know it would have to include Console.ReadLine...

Anywho, if anyone can help that'd be prima.
Thanks for answering that. ne more question. How would I make something like 'if they type 'help' it shows some help'. Here's what I was thinking (won't work though).

string Help;
Help = Console.ReadLine();
if Help = ("/help"); Then
Console.WriteLine("Here's some help")
Else
Console.WriteLine("What the hell did you type?!")

Last Question (honest!)
 
Back
Top