如何以编程方式在现有文件中添加文件夹? [英] how to add folder inside an existing programatically?

查看:79
本文介绍了如何以编程方式在现有文件中添加文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我这里有一个创建文件夹的代码。 但我想在现有文件夹中创建一个文件夹..



有可能吗?



提前致谢..



Hi guys, I have a code here that creates folder. but i want to create a folder in an existing folder..

is it possible?

Thanks in advance..

Dim appPath As String = Request.PhysicalApplicationPath.ToString()
Dim newnewDirectory As New DirectoryInfo(appPath + TextBox_host_remarks.Text)
newnewDirectory.Create()

推荐答案

你可以通过静态方法做到这一点

You can do this via the static method
Directory.CreateDirectory(@"C:\ExistingFolder\MyNewFolder");



Directory.CreateDirectory方法 [ ^ ]



或者您可以使用DirectoryInfo DirectoryInfo.CreateSubdirectory方法 [ ^ ]



您可以在MSDN上找到很好的例子。请参阅上面的链接。


Directory.CreateDirectory Method[^]

Or you can use DirectoryInfo DirectoryInfo.CreateSubdirectory Method[^]

There are pretty good examples at MSDN you can follow. See the links above.


这篇关于如何以编程方式在现有文件中添加文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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