VB 6.0 code for delete all files in a folder

Unknown | 1:10 AM |

On Error Resume Next
MkDir App.Path & "\Temp"

DeleteAllFiles App.Path & "\Temp"

Public Function DeleteAllFiles(ByVal FolderSpec As String) As Boolean

Dim oFs As New FileSystemObject
Dim oFolder As Folder
Dim oFile As file


If oFs.FolderExists(FolderSpec) Then
Set oFolder = oFs.GetFolder(FolderSpec)
On Error Resume Next
For Each oFile In oFolder.Files
oFile.Delete True 'setting force to true
'deletes read-only file
Next
DeleteAllFiles = oFolder.Files.Count = 0
End If

End Function

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....