닷넷 응용프로그램의 어셈블리 파일에는 메타데이터가 들어있다.BCL에서 제공되는 리플렉션 관련 클래스를 이용하면 메타데이터 정보를 얻는 것이 가능하므로 이제 그 유용성을 직접 코드로 확인해 보자. 리플렉션은 C#코드가 빌드되어 어셈블리에 포함되는 경우 그에 대한 모든 정보를 조회할 수 있는 기술을 일컫는다. using System;using System.Threading;using System.Collections.Generic;using static System.Net.Mime.MediaTypeNames;using System.Reflection;namespace csharp_study{ class Program { static void Main(string[] args) { AppDomain curre..
c#의 전처리기 지시문은 특정 소스코드를 상황에 따라 컴파일 과정에서 추가/제거 하고 싶을때 사용한다.하나의 코드로 조건을 걸어 여러개의 상황을 만족하는 코드를 작성할때 유용하다. 아래처럼 #if /#endif 를 사용하여 컴파일 조건을 걸 수 있다. using System;using System.Threading;using System.Collections.Generic;using static System.Net.Mime.MediaTypeNames;namespace csharp_study{ class Program { static void Main(string[] args) { string txt = Console.ReadLine(); if (string.IsNullOrEmpty(txt) == fals..