在目录内创建文件夹和子文件夹 [英] Create folders and Subfolders inside a directory

查看:143
本文介绍了在目录内创建文件夹和子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我以前上传文件之前,所有文件都存储在NewFolder1中.现在,在上传文件之前,用户从下拉下载列表中选择某些字段.例如,用户将从不同的下拉列表中选择学校,部门,类别和位置.因此,对于每个学校部门,都需要根据用户的选择来创建类别和位置子文件夹.例如,学校X,部门Y,类别Z和位置LA,文件将上传到Newfolder1/X/Y/Z/LA .关于在运行时如何执行操作的任何想法...

感谢

解决方案

Directory.CreateDirectory,只要您为ASP.NET用户授予对文件系统的正确权限.


Before when i used to upload a file,all file were stored in NewFolder1.Now before uploading the file,the user selects certain field from the dropdownload list.eg user will select school,department,category and locations from different dropdownlist.so for each school department,category and location subfolders needs to be created depending on what the user chooses.For Example School X,department Y,category Z and location LA,the file will be uploaded in Newfolder1/X/Y/Z/LA.Any ideas on how to do it during runtime...

Thanks

解决方案

Directory.CreateDirectory, so long as you give your ASP.NET user the correct rights to the file system.


这篇关于在目录内创建文件夹和子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆