■ Assembly 클래스의 GetExecutingAssembly 정적 메소드를 사용해 애플리케이션의 실행 디렉토리 경로를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
using System.IO; using System.Reflection; #region 애플리케이션 실행 디렉토리 경로 구하기 - GetApplicationExecutableDirectoryPath() /// <summary> /// 애플리케이션 실행 디렉토리 경로 구하기 /// </summary> /// <returns>애플리케이션 실행 디렉토리 경로</returns> public static string GetApplicationExecutableDirectoryPath() { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } #endregion |