xxxxxxxxxx
// Directory class is in the System.IO namespace
Directory.CreateDirectory(dir);
xxxxxxxxxx
string dir = @"C:\test";
// If directory does not exist, create it
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
xxxxxxxxxx
string subPath ="ImagesPath"; // Your code goes here
bool exists = System.IO.Directory.Exists(Server.MapPath(subPath));
if(!exists)
System.IO.Directory.CreateDirectory(Server.MapPath(subPath));
xxxxxxxxxx
string dir = @"C:\test";
// If directory does not exist, create it
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
xxxxxxxxxx
Using System.IO;
//gets the directory where the program is launched from and adds the foldername
string path = Path.Combine(Environment.CurrentDirectory, "foldername");
//Creates a directory(folder) if it doesen't exist
Directory.CreateDirectory(path);