The source code to get the full path of the current directory using Environment class is given below. The given program is compiled and executed successfully.
using System;
class Sample
{
//Entry point of Program
static public void Main()
{
string curDir = Environment.CurrentDirectory;
Console.WriteLine("Full path of current directory:");
Console.WriteLine(curDir);
}
}
Output:
Full path of current directory:
C:\Users\Arvind\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug
Press any key to continue . . .
Program:
The source code to get the full path of the current directory using Environment class is given below. The given program is compiled and executed successfully.
Output: