删除其子目录目录(非空) [英] delete a directory having subdirectory (not empty)

查看:151
本文介绍了删除其子目录目录(非空)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能删除它里面有一个目录的子目录这不是空的。

How can i delete a directory having subdirectory inside it which is not empty.

感谢您的答案

但现在,当我在运行时delete一个任意目录因此它会带我到登录页面。

but now when am deleteing any directory at run time so it will take me to the login page.

推荐答案

您可以使用 Directory.Delete 方法传递真正作为第二个参数。

You could use the Directory.Delete method passing true as second argument.

Directory.Delete(@"c:\somedirectory", true);

这篇关于删除其子目录目录(非空)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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