Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
ディレクトリ C# · 実践的な指導
グローバルまたは指定されたエイリアスを介して名前空間を参照します。 extern エイリアスは、異なるアセンブリ内の同じ名前の型を区別できます。
この例を Example.cs として別に保存し、このページの他の例とは独立して実行してください。
Example.cs
Example.cs:
// PROJECT-EXAMPLE global::System.Console.WriteLine("Ready");
結果:
Ready
global::Namespace.Type / alias::Type
using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.IO; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; public static class Program { public static async Task Main(string[] args) { global::System.Console.WriteLine(typeof(global::System.String).Name); } }
using Core = System; public static class Program { public static void Main() { Core::Console.WriteLine(Core::Math.Abs(-4)); } }
公式ソース: Microsoft Learn。
There was an error while loading. Please reload this page.