C# DirectoryInfo Exists

Description

DirectoryInfo Exists Gets a value indicating whether the directory exists.

Syntax

DirectoryInfo.Exists has the following syntax.


public override bool Exists { get; }

Example

Gets a value indicating whether the directory exists.


using System;/*from ww  w.j a v a  2s .co m*/
using System.IO;

class Class1
{
   public static void Main(){
      DirectoryInfo  target = new DirectoryInfo("c:/abc");
      Console.WriteLine(target.Exists);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter