I\'m working on a C# project where I must build paths to various files and folders. These are all under one root folder which I have specified in my Web.config file.
<Use the Path class to build up your paths. It will do the right thing.
Performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner.
var full = Path.Combine(baseDir, dirFragment);
Use Path.Combine to concatenate path tokens.
If the path is a file to set/change the extension use Path.ChangeExtension.