我想删除根目录下的所有文件夹e:\ trichy.root文件夹也包含子文件夹,如e:\ trichy \ chn \ 20008 \ 20204 * .mp3文件。请帮助我 。总是出现错误。关于使用vb.net的子文件夹下的文件夹
Dim rootfolder1 As FileInfo
rootfolder1 = txtRootFolder.Text
Try
If Directory.Exists(rootfolder1) Then
Dim files() As String = Directory.GetDirectories(rootfolder1)
For Each file As String In files
Dim fi As FileInfo = New FileInfo(file)
If (fi.LastAccessTime < DateTime.Now.AddMonths(-3)) Then
fi.Delete()
display_status("files are deleted successfully")
End If
Next
End If
Catch ex As Exception
display_status("Error in file deletion" & ex.Message)
End Try
请帮我删除这个根文件夹下的子文件夹下的文件?
你歌厅什么错误? – FosterZ 2012-03-06 11:55:18
你为什么不发布错误细节?我们应该猜测吗? – Oded 2012-03-06 11:55:43