C #에서 두 파일 경로를 어떻게 결합합니까?
답변
아래 예제와 같이 Path.Combine () 을 사용해야 합니다.
string basePath = @"c:\temp";
string filePath = "test.txt";
string combinedPath = Path.Combine(basePath, filePath);
// produces c:\temp\test.txt
C #에서 두 파일 경로를 어떻게 결합합니까?
아래 예제와 같이 Path.Combine () 을 사용해야 합니다.
string basePath = @"c:\temp";
string filePath = "test.txt";
string combinedPath = Path.Combine(basePath, filePath);
// produces c:\temp\test.txt