標準入力ストリームを取得します。
オーバーロードの一覧
標準入力ストリームを取得します。
[Visual Basic] Overloads Public Shared Function OpenStandardInput() As Stream
[JScript] public static function OpenStandardInput() : Stream;
指定したバッファ サイズに設定された標準入力ストリームを取得します。
[Visual Basic] Overloads Public Shared Function OpenStandardInput(Integer) As Stream
[JScript] public static function OpenStandardInput(int) : Stream;
使用例
OpenStandardInput の使用方法については、次のコード例を参照してください。
Public Class Decoder
Public Shared Sub Main()
Dim inputStream As Stream = Console.OpenStandardInput()
Dim bytes(100) As Byte
Console.WriteLine("To decode, type or paste the UTF7 encoded string and press enter:")
Console.WriteLine("(Example: ""M+APw-nchen ist wundervoll"")")
Dim outputLength As Integer = inputStream.Read(bytes, 0, 100)
Dim chars As Char() = Encoding.UTF7.GetChars(bytes, 0, outputLength)
Console.WriteLine("Decoded string:")
Console.WriteLine(New String(chars))
End Sub 'Main
End Class 'Decoder
[C#]
public class Decoder {
public static void Main() {
Stream inputStream = Console.OpenStandardInput();
byte[] bytes = new 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);
char[] chars = Encoding.UTF7.GetChars(bytes, 0, outputLength);
Console.WriteLine("Decoded string:");
Console.WriteLine(new string(chars));
}
}
[C++]
int main() {
Stream* inputStream = Console::OpenStandardInput();
Byte bytes[] = new Byte[100];
Console::WriteLine(S"To decode, type or paste the UTF7 encoded string and press enter:");
Console::WriteLine(S"(Example: \"M+APw-nchen ist wundervoll\")");
int outputLength = inputStream->Read(bytes, 0, 100);
Char chars[] = Encoding::UTF7->GetChars(bytes, 0, outputLength);
Console::WriteLine(S"Decoded string:");
Console::WriteLine(new String(chars));
}
[JScript]
var inputStream : Stream = Console.OpenStandardInput();
var bytes : byte[] = new byte[100];
Console.WriteLine("To decode, type or paste the UTF7 encoded string and press enter:");
Console.WriteLine("(Example: \"M+APw-nchen ist wundervoll\")");
var outputLength : int = inputStream.Read(bytes, 0, 100);
var chars : char[] = Encoding.UTF7.GetChars(bytes, 0, outputLength);
Console.WriteLine("Decoded string:");
Console.WriteLine(chars);