Effective way of combining a path variable.

Posted by Tripati.patro under C# category on | Points: 40 | Views : 2139
Path.Combine method can be used to combine different parts of a path.

var path1 = @"D:\DotNetFunda";
var path2 = @"Section\Articles";

var simplePath = path1 + "\\" + path2;
// OR
// Better way to combine parts of a absolute path.
var effectiveWayPath = System.IO.Path.Combine(path1, path2);

Comments or Responses

Posted by: Madhu.b.rokkam on: 2/22/2011 Level:Bronze | Status: [Member] [MVP] | Points: 10
Good one Tripati..

Login to post response