This Program will help you to combine directory path of a file. C# provide a method Path.Combine to combine path.
using System;
using System.IO;
namespace MyApp
{
class Path_class
{
static void Main()
{
string strpath = Path.Combine(@"C:\Windows\", "System32");
strpath = Path.Combine(strpath, "calc.exe");
Console.WriteLine(strpath);
Console.Read();
}
}
}
No comments:
Post a Comment