C# program to get complete path of current directory

Syntax

string Directory.GetCurrentDirectory();

Program

using System;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            string curDir = "";

            curDir = Directory.GetCurrentDirectory();

            Console.WriteLine("Current Directory is :\n"+curDir);
        }
    }
}

Output

C:\Users\Manju\Documents\Visual Studio 2010\Projects\ihelp\ConsoleApplication1\
ConsoleApplication1\bin\Debug

Leave a Comment

error: Alert: Content is protected!!