How to create a directory on server

Neeks
Posted by Neeks under ASP.NET category on | Views : 4884
You can get the path of server's root directory using
Request.PhysicalApplicationPath

Now assign this path to string variable
string pathToSave = Request.PhysicalApplicationPath;

Now create a directory on the server
Append the Folder name to the string variable
pathToSave  +=  "folderName" 

System.IO.Directory.CreateDirectory(pathToSave);

Now your directory is created.

Comments or Responses

Login to post response