VB .NET: how to use wildcards to delete files in batch mode?
Posted by Admin L in .NET Programming on 27-07-2012. Tags: .NET Programming Experience, C# FAQ, C# Programming Experience, C# Skills, .NET FAQ, .NET Skills, VB .NET Programming Experience, VB .NET FAQ, VB .NET Skills
Author: Nosa Lee
Original Address: https://www.seeksunslowly.com/vb-net-how-to-use-wildcards-to-delete-files-in-batch-mode
To reprint this article, please indicate the source, thank you.
_____________________________________
In the programming work, we usually need to use wildcards to delete files in batch mode.
For .NET, it is very easy, does not need to do a circulation in a directory.
Just need to use Kill method!
Sample Code (VB 2008):
Microsoft.VisualBasic.FileSystem.Kill("E:\test\*.jpg")
For C#, you can also use kill to delete files in batch mode with wildcards, but please note that you need to using Microsoft.VisualBasic namespace.