How do I join two file paths in C#?
You have to use Path.Combine() as in the example below:
string basePath = @"c:emp"; string filePath = "test.txt"; string combinedPath = Path.Combine(basePath, filePath); // produces c:empest.txt
2.1m questions
2.1m answers
60 comments
57.0k users