Base de conhecimentoCentro de Exames
PT · PTPortuguês (Portugal)
Escolher idioma13

CKTIS / C#

System.Console: referência prática

System.Console: referência prática: Console expõe os fluxos padrão de entrada, saída e erro do processo, juntamente com operações de texto.

Versão: .NET API; verified on .NET 10.0.14

Sintaxe

System.Console /* select a documented member or constructor */

Console expõe os fluxos padrão de entrada, saída e erro do processo, juntamente com operações de texto.

Usa-a em programas de linha de comandos, diagnóstico local e saída stdout ou stderr que possa ser redirecionada.

A disponibilidade, codificação e interatividade dependem do host e WriteLine não substitui registo estruturado duradouro.

ReadLine pode devolver null no fim da entrada e uma saída redirecionada pode não suportar cores, cursor ou janela.

O programa completo usa realmente System.Console; o stdout exato esperado é CKTIS.

Exemplos

using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;

Console.WriteLine("CKTIS");

Resultado

CKTIS

O programa completo usa realmente `System.Console`; o stdout exato esperado é `CKTIS`.

Fontes