using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
DirectoryInfo d = new DirectoryInfo("mydir");
Console.WriteLine("FullName of directory:");
Console.WriteLine(d.FullName);
}
}
}
Output
FullName of directory:
C:\Users\Arvind\Documents\Visual Studio 2010\Projects\ihelp\ConsoleApplication1\
ConsoleApplication1\bin\Debug\mydir
In this program, we create an object of DirectoryInfo class and initialize with a directory-name, then get complete path of given directory using FullName property of DirectoryInfo class.
Note: In above program, we need to remember, when we use "DirectoryInfo" class, System.IO namespace must be included in the program.
Program
Output
In this program, we create an object of DirectoryInfo class and initialize with a directory-name, then get complete path of given directory using FullName property of DirectoryInfo class.
Note: In above program, we need to remember, when we use "DirectoryInfo" class, System.IO namespace must be included in the program.