가. 프로세스 이름 가져오기
System.Diagnostics.Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
string strProcess = currentProcess.ProcessName;
나. 현재의 실행 폴더를 가져온다.
string strFolder = System.IO.Directory.GetCurrentDirectory();
다. 현재 폴더와 프로세스를 결합한 파일경로
string strFilePath = string.Format("{0}\\{1}.exe", System.IO.Directory.GetCurrentDirectory(), this.currentProcess.ProcessName);
'C#' 카테고리의 다른 글
[C#]IndexOf() 문자열을 찾아 위치를 반환한다. (0) | 2024.02.22 |
---|---|
[C#]Split() 지정한 문자를 기준으로 문자열 분리 (0) | 2024.02.22 |
[C#]문자열 함수 SubString(), IndexOf(), LastIndexOf(), Split(), Replace(), Equals() (0) | 2024.02.22 |
[C#] 숫자에 콤마(Comma) 찍어보자 (0) | 2024.02.21 |
[C#]Trim(), TrimStart(), TrimEnd() 사용법 (0) | 2024.02.21 |