Wednesday 13 June 2012

How to create directory on server in asp.net runtime

Here is the complete code for creating new directory on server in asp.net

protected void btnCreate_Click(object sender, EventArgs e) { string directoryPath = Server.MapPath("~/") +txtDirName.Text; if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); lblMessage.Text = "Directory created"; } else lblMessage.Text = "Directory already exists"; }

No comments:

Post a Comment

Contact Us:

Email:

Vinodkumar434@gmail.com,
vinodtechnosoft@gmail.com

Skype Name:

vinodtechnosoft