NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Console.Read

Reads the next character from Console.In, which is set to the system's standard input stream by default.

[Visual Basic]
Public Shared Function Read() As Integer
[C#]
public static int Read();
[C++]
public: static int Read();
[JScript]
public static function Read() : int;

Return Value

The next character from the input stream, or negative 1 if no more characters are available.

Exceptions

Exception Type Condition
IOException An I/O error occured.

Example [C#]

[C#]

int i;
    char c;
    while (true)
    {
     i = Console.Read ();
     if (i == -1) break;
     c = (char) i;
     Console.WriteLine ("Echo: {0}",
c);
    }
    Console.WriteLine ("Done");
    return 0;
  }

See Also

Console Class | Console Members | System Namespace