Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing only .html files
Message
From
04/01/2005 17:19:33
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Removing only .html files
Miscellaneous
Thread ID:
00974212
Message ID:
00974212
Views:
66
I have a temporary directory that content some .html files. When the form is closed, I would like to delete all of them. So far, I have this:
        Dim loDirectory As New DirectoryInfo(Mid(lcTemp, 1, Len(lcTemp) - 1))
        Dim loFile As FileInfo
        For Each loFile In loDirectory.GetFiles()
            Framework.DeleteFile(lcTemp + loFile.Name)
        Next
But, this is removing all files. While I can check for the extension before deleting the file, I would like to For Each loop to only loop for .html files. Is there a way to have the loDirectory to be initialized for a specific extension only?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform