Repository navigation
CSharp Directive Pragma
Codex edited this page Oct 11, 2026
·
2 revisions
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Довідник C# · Практичне керівництво
warning disable/restore змінює вибрані попередження. checksum задає контрольну суму для налагоджувальної інформації згенерованого джерела.
Збережіть цей приклад окремо як Example.cs. Запускайте його незалежно від інших прикладів на сторінці.
Example.cs:
// PROJECT-EXAMPLE
#pragma warning disable CS0168
int unused;
#pragma warning restore CS0168
System.Console.WriteLine("Ready");Результат:
Ready
#pragma warning disable CODE / restore CODEusing 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)
{
#pragma warning disable CS0168
int unused;
#pragma warning restore CS0168
Console.WriteLine("Ready");
}
}#pragma checksum "Generated.cs" "{8829d00f-11b8-4213-878b-770e8597ac16}" "00112233445566778899AABBCCDDEEFF"
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)
{
Console.WriteLine("Source mapped");
}
}Офіційне джерело: Microsoft Learn.
ClassicUO — Bad Newbie & C# Scripts IDE