1. The system. Console. Write () method does not add a line break after the text is displayed, but keeps the current position on the same line. The system. Console. writeline () method will wrap.
2. The system. Console. Readline () method will be suspended.ProgramTo allow you to enter characters. Once you press enter to create a new row. The program will continue to run.
String firstname, lastname; system. Console. writeline ("Hey you! "); System. console. write ("Enter your first name:"); firstname = system. console. readline (); system. console. write ("Enter your last name:"); lastname = system. console. readline (); system. console. writeline ("your full name is {0} {1 }. ", firstname, lastname );
3. The data type returned by the system. Console. Read () method is an integer corresponding to the read character value. If no more characters are available,-1 is returned. To obtain the actual characters, you must first convert the integer into a character.
Int readvalue; char character; readvalue = system. Console. Read (); character = (char) readvalue; system. Console. writeline (character); system. Console. Readline ();
4. The system. Console. readkey () method returns the user's input after one key. It allows developers to intercept the user's key operations and execute corresponding rows. For example, you can only press the Enter key.
5. system. console. writeline ("your full name is {0} {1 }. ", firstname, lastname); {0} is the placeholder for the exchange index, and firstname is the corresponding variable.
If (system. console. readkey (true ). key = consolekey. enter) {system. console. readkey (true);} else {system. console. writeline ("input error! ");}