C# DirectoryInfo Delete()

Description

DirectoryInfo Delete() Deletes this DirectoryInfo if it is empty.

Syntax

DirectoryInfo.Delete() has the following syntax.


public override void Delete()

Returns

DirectoryInfo.Delete() method returns

Example

Deletes this DirectoryInfo if it is empty.


using System;//from w  w w .jav a2 s  .com
using System.IO;

class Test 
{
    public static void Main() 
    {
        DirectoryInfo di1 = new DirectoryInfo(@"c:\MyDir");

        di1.Delete();
    }
}




















Home »
  C# Tutorial »
    System.IO »




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