Console::OpenStandardInput Method ()
.NET Framework (current version)
Acquires the standard input stream.
Assembly: mscorlib (in mscorlib.dll)
public: [HostProtectionAttribute(SecurityAction::LinkDemand, UI = true)] static Stream^ OpenStandardInput()
This method can be used to reacquire the standard input stream after it has been changed by the SetIn method.
The following example illustrates the use of the OpenStandardInput property.
using namespace System; using namespace System::Text; using namespace System::IO; int main() { Stream^ inputStream = Console::OpenStandardInput(); array<Byte>^bytes = gcnew array<Byte>(100); Console::WriteLine( "To decode, type or paste the UTF7 encoded string and press enter:" ); Console::WriteLine( "(Example: \"M+APw-nchen ist wundervoll\")" ); int outputLength = inputStream->Read( bytes, 0, 100 ); array<Char>^chars = Encoding::UTF7->GetChars( bytes, 0, outputLength ); Console::WriteLine( "Decoded string:" ); Console::WriteLine( gcnew String( chars ) ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: