ADO DOT NET
Well-known member
- Joined
- Dec 20, 2006
- Messages
- 156
Hi,
I want to check if there is any text file in the application path, then delete all of them.
So I use this code:
But I get error:
A first chance exception of type System.ArgumentException occurred in mscorlib.dll
I want to check if there is any text file in the application path, then delete all of them.
So I use this code:
Code:
If System.IO.Directory.GetFiles(My.Application.Info.DirectoryPath, "*.txt").Length > 0 Then
My.Computer.FileSystem.DeleteFile(My.Application.Info.DirectoryPath + "\*.txt")
End If
A first chance exception of type System.ArgumentException occurred in mscorlib.dll