2011-08-31 5 views

답변

4

당신은 현재 응용 프로그램의 디렉토리를 얻을 수 있습니다 : 이제까지

Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 

또는 어떤 위치를 : 당신은 다음 문자열이 필요

string appPath = Path.GetDirectoryName(Application.ExecutablePath); 

확인할보고 비교 경로 startswith 경우 테스트하고 싶다면, 목록 os 특수 폴더에 대해서는 here을 참조하십시오. 이는 각 OS 버전에서 적절하게 해결됩니다.

1
bool isUsersPath = System.Reflection.Assembly.GetExecutingAssembly().Location.StartsWith(System.Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) 
관련 문제