Sponsored Ad

Sunday, March 13, 2011

How to Combine Directory Path using C#

This Program will help you to combine directory path of a file. C# provide a method Path.Combine to combine path.

How to Combine Path using C#

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

Sponsored Ad

Development Updates