2010-08-02 7 views
4

주어진 경로를 구문 분석 "C : \ 사용자 \ TestProject \ TestProject.csproj내가 경로가 C#을

내가 때까지 경로를 얻으려면"C : 사용자 TestProject

감사합니다 \ \!

답변

8
string dir = System.IO.Path.GetDirectoryName(myPath); 
3
string fullFilename= @"C:\Users\TestProject\TestProject.csproj"; 

string folder = Path.GetDirectoryName(fullFilename);