/ Published in: VB.NET
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Shared Sub EmptyDirectory(ByVal _dirPath As String) If Not Directory.Exists(_dirPath) Then Return End If Dim files() As String files = Directory.GetFileSystemEntries(_dirPath) For Each element As String In files 'Do not clear sub directories If (Not Directory.Exists(element)) Then DeleteFile(Path.Combine(_dirPath, Path.GetFileName(element))) End If Next End Sub