Skip to content

KO CSharp Directive Line

Codex edited this page Oct 11, 2026 · 2 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

초기 위치 표시

핸드북 C# · 실용 가이드

진단에서 줄 번호와 파일 이름을 변경하거나 디버거에서 해당 섹션을 숨깁니다. 수행 중인 작업을 변경하지 않습니다.

간단한 예제 (Example.cs)

이 예제를 Example.cs로 따로 저장하고 이 페이지의 다른 예제와 독립적으로 실행하세요.

Example.cs:

// PROJECT-EXAMPLE
#line 100 "Original.cs"
System.Console.WriteLine("Mapped");
#line default

결과:

Mapped

통사론

#line number "file" / #line hidden / #line default

예시 1

#line 100 "Original.cs"
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("Mapped");
    }
}

예시 2

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)
    {
        #line hidden
        int value = 3;
        #line default
        Console.WriteLine(value);
    }
}

공식 출처: Microsoft 학습.

Clone this wiki locally