var filePath = @"c:\doc\1.txt";
var dirPath1 = @"c:\music\";
var dirPath2 = @"c:\movie";
路径拼接
Console.WriteLine(Path.Combine(dirPath1, "a.mp3")); //c:\music\a.mp3
Console.WriteLine(Path.Combine(dirPath2, "b.mp4")); //c:\movie\b.mp4
2022-04-23 03:32:06
var filePath = @"c:\doc\1.txt";
var dirPath1 = @"c:\music\";
var dirPath2 = @"c:\movie";
Console.WriteLine(Path.Combine(dirPath1, "a.mp3")); //c:\music\a.mp3
Console.WriteLine(Path.Combine(dirPath2, "b.mp4")); //c:\movie\b.mp4