CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Entering String

  1. #1
    Join Date
    Jul 2004
    Location
    South Africa
    Posts
    71

    Angry Entering String

    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

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    210

    Re: Entering String

    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"

  3. #3
    Join Date
    Jul 2004
    Location
    South Africa
    Posts
    71

    Angry Re: Entering String

    Quote Originally Posted by MNovy
    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
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured