Hi Lou,
The File.Exists(string) method takes a file path as an argument. It does not
support using wildcards, because it is used to determine whether or not a
single file having the file name exists at the location specified. Wildcard
searches return multiple files. The Directory.GetFiles(string, string)
method will return an array of file paths for files in a Directory which
match the search pattern specified. The first argument is the path to the
directory, and the second is the search pattern. If there are no matching
files, the array will be empty.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"Lou" <Lo*@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Question:
I can't seem to get file.exists(filename) to return true when I search
using
wildcards, and I know there's a file in that dir with that extension.
here's the path
dim yesno as boolean
FileName = "D:\Documents and Settings\Lou\My Documents\Visual Studio
Projects\Lucky7\Lucky7\bin\*.txt"
yesno=file.exists(filename)
file.exists keeps returning false when there is a readme.txt file in that
dir.
It works if I explicitly name the file but not with the wildcard.
so...what am I doing wrong?
Thanks for helping this noobie.