当前位置: 技术问答>java相关
请问一个删除目录的问题
来源: 互联网 发布时间:2015-08-19
本文导语: 我想删除一个目录,但目录里面还有目录,用下面的方法删除,编译时它总是提示出错: public boolean Deldir(String vpath) { String pathName=""; try { pathName = vpath; File delPath = new File(pathName); if (delPath.exists()) { String[] ...
我想删除一个目录,但目录里面还有目录,用下面的方法删除,编译时它总是提示出错:
public boolean Deldir(String vpath)
{
String pathName="";
try {
pathName = vpath;
File delPath = new File(pathName);
if (delPath.exists())
{
String[] strList;
strList = delPath.list();
for (int i = 0; i
public boolean Deldir(String vpath)
{
String pathName="";
try {
pathName = vpath;
File delPath = new File(pathName);
if (delPath.exists())
{
String[] strList;
strList = delPath.list();
for (int i = 0; i