Delete Dir - CSharp File IO

CSharp examples for File IO:Directory

Description

Delete Dir

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.IO;/*from   ww  w  .  j  a va2 s .c om*/
using System.Collections.Generic;
using System;

public class Main{
        public static void DeleteDir(string dir)
        {
            if (dir.Length == 0) return;
            if (Directory.Exists(System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\" + dir))
                Directory.Delete(System.Web.HttpContext.Current.Request.PhysicalApplicationPath + "\\" + dir);
        }
}

Related Tutorials