Q:

C# program to get complete path of current directory

0

C# program to get complete path of current directory

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

Note: In above program, we need to remember, when we use "Directory" class, System.IO namespace must be included in the program.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# file handling (File class) solved programs/examples

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C# program to get the list of sub-directories of g... >>
<< C# program to check given directory exists or not...