Link to home
Start Free TrialLog in
Avatar of mkrisz
mkrisz

asked on

search files by keyword/wildcard in csharp

Dear experts,

I would like to write just a really small console application which searches for files (like when you search in windows explorer) by keyword. Can I somehow use the built in search capabilities in Windows? Because I already found a code to do file search, but that code only search that particular directory WITHOUT subdirectories :(
I would need two output: the name of the file and the path of the file. Just these two.

Thank you a lot for your help,
Chris
ASKER CERTIFIED SOLUTION
Avatar of x77
x77
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To get DirectoryPath / FileName:

            foreach (string f in Result)
            {
                string PathName = System.IO.Path.GetDirectoryName(f);
                string FileName = System.IO.Path.GetFileName(f);
            }

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I meant "features" not "futures"... :)
Avatar of mkrisz
mkrisz

ASKER

ok.