Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing only .html files
Message
De
04/01/2005 17:19:33
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Removing only .html files
Divers
Thread ID:
00974212
Message ID:
00974212
Vues:
68
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform