Console.OpenStandardInput Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Haalt de standaardinvoerstroom op.
Overloads
| Name | Description |
|---|---|
| OpenStandardInput() |
Haalt de standaardinvoerstroom op. |
| OpenStandardInput(Int32) |
Hiermee verkrijgt u de standaardinvoerstroom, die is ingesteld op een opgegeven buffergrootte. |
OpenStandardInput()
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
Haalt de standaardinvoerstroom op.
public:
static System::IO::Stream ^ OpenStandardInput();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.IO.Stream OpenStandardInput();
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.IO.Stream OpenStandardInput();
public static System.IO.Stream OpenStandardInput();
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member OpenStandardInput : unit -> System.IO.Stream
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member OpenStandardInput : unit -> System.IO.Stream
static member OpenStandardInput : unit -> System.IO.Stream
Public Shared Function OpenStandardInput () As Stream
Retouren
De standaardinvoerstroom.
- Kenmerken
Voorbeelden
In het volgende voorbeeld ziet u het gebruik van de OpenStandardInput methode.
using System;
using System.Text;
using System.IO;
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));
}
}
open System
open System.Text
let inputStream = Console.OpenStandardInput()
let bytes = Array.zeroCreate<byte> 100
Console.WriteLine "To decode, type or paste the UTF7 encoded string and press enter:"
Console.WriteLine "(Example: \"M+APw-nchen ist wundervoll\")"
let outputLength = inputStream.Read(bytes, 0, 100)
let chars = Encoding.UTF7.GetChars(bytes, 0, outputLength)
Console.WriteLine "Decoded string:"
Console.WriteLine(string chars)
Imports System.Text
Imports System.IO
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
End Class
Opmerkingen
Deze methode kan worden gebruikt om de standaardinvoerstroom opnieuw op te vragen nadat deze is gewijzigd door de SetIn methode.
Zie ook
Van toepassing op
OpenStandardInput(Int32)
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
- Bron:
- Console.cs
Hiermee verkrijgt u de standaardinvoerstroom, die is ingesteld op een opgegeven buffergrootte.
public:
static System::IO::Stream ^ OpenStandardInput(int bufferSize);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.IO.Stream OpenStandardInput(int bufferSize);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.IO.Stream OpenStandardInput(int bufferSize);
public static System.IO.Stream OpenStandardInput(int bufferSize);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member OpenStandardInput : int -> System.IO.Stream
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member OpenStandardInput : int -> System.IO.Stream
static member OpenStandardInput : int -> System.IO.Stream
Public Shared Function OpenStandardInput (bufferSize As Integer) As Stream
Parameters
- bufferSize
- Int32
Deze parameter heeft geen effect, maar de waarde moet groter dan of gelijk aan nul zijn.
Retouren
De standaardinvoerstroom.
- Kenmerken
Uitzonderingen
bufferSize is kleiner dan of gelijk aan nul.
Opmerkingen
Deze methode kan worden gebruikt om de standaarduitvoerstroom opnieuw te genereren nadat deze door de SetIn methode is gewijzigd.