이 글보다는 현재 실행중인 프로그램의 절대경로 받아오기 in C# 를 참고하기를 추천합니다!

1. 확장자를 제외한 프로세스 이름 가져오기
System.Diagnostics.Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
String s = currentProcess.ProcessName;

2. 현재 실행되고 있는 프로그램 디렉토리
String strFolder = System.IO.Directory.GetCurrentDirectory();

이 둘을 합치면 완전체는

System.IO.Directory.GetCurrentDirectory() + "\\" + this.currentProcess.ProcessName + ".exe"

// 출처 : 데브펌
Posted by 병아리

사이드바 열기