Answers:
您必须按照以下示例使用Path.Combine():
string basePath = @"c:\temp";
string filePath = "test.txt";
string combinedPath = Path.Combine(basePath, filePath);
// produces c:\temp\test.txt
string basePath = @"c:\temp\"; string filePath = @"c:\dev\test.txt"; /* for whatever reason */ string combined = Path.Combine(basePath, filePath);
产生@“ c:\ dev \ test.txt”
Path.Combine(path1, path2);