G
Guest
Hello. Anyone know how to use the FileInfo class to search for a specific
file in a directory? My problem is the specific file I am looking for, but
the actual filename can contain alot of extra characters that are created
when a batch process takes place. for example, I know the root path and the
first few letters of the filename.
Root: C:\TestFolder
1st File to iterate: SThompson.123.exit.Read.out
2nd File to iterate: SThompson.email.Lg334.ini
OtherFile: SThompson.gif
So the information I have, stored in exposed public properties are the first
and last name (S Thompson)
The goal is to look for the .INI file ONLY. The problem is the rest of the
characters between the SThompson and the .INI change constantly b/c of batch
processing. Here is example I can think of
{
...... //path argument is stored from XML file
SomeClass sClass = new SomeClass
sClass.ReadFile() // method gets the properties
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] files2 = diSftp.GetFiles(i._Fname.Substring(1, 1).Trim +
i._Lname, "*.out);
file in a directory? My problem is the specific file I am looking for, but
the actual filename can contain alot of extra characters that are created
when a batch process takes place. for example, I know the root path and the
first few letters of the filename.
Root: C:\TestFolder
1st File to iterate: SThompson.123.exit.Read.out
2nd File to iterate: SThompson.email.Lg334.ini
OtherFile: SThompson.gif
So the information I have, stored in exposed public properties are the first
and last name (S Thompson)
The goal is to look for the .INI file ONLY. The problem is the rest of the
characters between the SThompson and the .INI change constantly b/c of batch
processing. Here is example I can think of
{
...... //path argument is stored from XML file
SomeClass sClass = new SomeClass
sClass.ReadFile() // method gets the properties
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] files2 = diSftp.GetFiles(i._Fname.Substring(1, 1).Trim +
i._Lname, "*.out);