Q:

C# program to demonstrate the use of FullName property

0

DirectoryInfo.FullName

This is a method of "DirectoryInfo" class, it returns the full (complete) path of given directory.

Syntax:

string DirectoryInfo.FullName

Return value:

Returns the complete path of given 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()
        {
            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.

 

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 demonstrate the use of Exists proper...