Programing

C #에서 두 경로를 어떻게 조인합니까?

lottogame 2020. 8. 28. 07:47
반응형

C #에서 두 경로를 어떻게 조인합니까?


C #에서 두 파일 경로를 어떻게 결합합니까?


아래 예제와 같이 Path.Combine () 을 사용해야 합니다.

string basePath = @"c:\temp";
string filePath = "test.txt";
string combinedPath = Path.Combine(basePath, filePath); 
// produces c:\temp\test.txt

System.IO.Path.Combine () 이 필요합니다.

Path.Combine(path1, path2);

참고 URL : https://stackoverflow.com/questions/961704/how-do-i-join-two-paths-in-c

반응형