Create Folder/Directory Check Existing

Create Folder/Directory and Check Existing or not

Here Session[“user”] is a name which will be created…. ‘upload’ is a floder/Director that already created.

if(Directory.Exists(Server.MapPath(“upload”) + “/” + Session[“user”].ToString()))
{
}
else
{
System.IO.Directory.CreateDirectory(Server.MapPath(“upload”) + “/” + Session[“user”].ToString());
}

Share