File.Exists alternative?

  • Thread starter Thread starter Dave Harris
  • Start date Start date
D

Dave Harris

Is there an alternate way to determine the existence of files other than
the File.Exists method. I have this code...

If File.Exists("tblm*.*") then
Kill("tblm*.*")
End If

The Kill method works fine with the asterisk as a placeholder but the
File.Exists method does not. I need some way to detect the presence of files
that all begin with tblm and then if there, delete them.
Any ideas? Thanks in advance!!

Dave
 
Is there an alternate way to determine the existence of files other than
the File.Exists method. I have this code...

If File.Exists("tblm*.*") then
Kill("tblm*.*")
End If

The Kill method works fine with the asterisk as a placeholder but the
File.Exists method does not. I need some way to detect the presence of files
that all begin with tblm and then if there, delete them.
Any ideas? Thanks in advance!!

Dave

Try using something like this:

Imports System.IO

Dim szPath as String = Directory.GetCurrentDirectory()
If Directory.GetFiles("C:\TEMP", "tblm*.*").Length() > 0 Then
Kill("tblm*.*")
End If


// CHRIS
 
Back
Top