CKTIS / C#
program entry point: praktická referencia
program entry point: praktická referencia: Vstupný bod spúšťa proces, prijíma argumenty a určuje exit code.
Verzia: C# language and .NET 10 reference runtime
Syntax
// program entryVstupný bod spúšťa proces, prijíma argumenty a určuje exit code.
Validujte args, konfigurujte služby a delegujte prácu testovateľnej funkcii.
Top-level statements a výslovný Main nesmú vytvoriť konkurenčné vstupné body.
Prázdne args, chyba štartu a zrušenie vyžadujú predvídateľnú správu a exit code.
Úplný program skutočne používa program entry point; presne očakávaný stdout je arguments:0.
Príklady
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($"arguments:{args.Length}");
Výsledok
arguments:0
Úplný program skutočne používa `program entry point`; presne očakávaný stdout je `arguments:0`.