.....
Printable View
.....
That's very possible. I don't know the exact code but you use something like For Each ffile as File in Directory.GetAllFiles and then an if statement for each file to see if the end has the same extension as dem1, then you use .Kill to delete it. Someone will probably post some code for you.
.....
Try this
Code:Dim Dir As String = "C:\Directory"
Dim fileList As New List(Of String)
fileList.AddRange(My.Computer.FileSystem.GetFiles(Dir))
For x As Integer = 0 To fileList.Count - 1
Dim theFile As String = fileList.Item(x)
If My.Computer.FileSystem.GetFileInfo(theFile).Extension = ".dem1" Then
My.Computer.FileSystem.DeleteFile(Dir & "\" & theFile)
End If
Next
.....
Sorry, take out Dir & "\" &.
Code:Dim Dir As String = "C:\Directory"
Dim fileList As New List(Of String)
fileList.AddRange(My.Computer.FileSystem.GetFiles(Dir))
For x As Integer = 0 To fileList.Count - 1
Dim theFile As String = fileList.Item(x)
If My.Computer.FileSystem.GetFileInfo(theFile).Extension = ".dem1" Then
My.Computer.FileSystem.DeleteFile(theFile)
End If
Next
.....