Create Dir - CSharp File IO

CSharp examples for File IO:Directory

Description

Create Dir

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.IO;/*  w  w  w .j a  va 2  s .  c  o  m*/
using System.Collections.Generic;
using System;

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

Related Tutorials