asp.net creates a folder in the root directory of the website

巴扎黑
Release: 2016-12-19 15:53:59
Original
1928 people have browsed it

Suppose you want to create a folder hovertree in the root directory of the asp.net website, the C# code is as follows:

string m_keleyiFolderName = Server.MapPath("/hovertree");
if (Directory.Exists(m_keleyiFolderName))
{
//文件夹已经存在
return;
}
else
{
try
{
Directory.CreateDirectory(m_keleyiFolderName);
//创建成功
}
catch (Exception ex)
{
//创建失败 ,原因: ex.Message
}
}
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!