-2

I have to search the filepath from filename into my harddisk.

I was wondering if there is a way to use main Windows 7 search manager (start->edit text with "search programs and file". Or simply if there is a quick way to find filepath within computer

Can you help me?

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
CeccoCQ
  • 3,746
  • 12
  • 50
  • 81
  • 3
    Please explain exactly what you are trying to achieve, your description is not very clear. Also, is this a programming question or are you asking for software recommendations? – Oded Feb 09 '11 at 09:47
  • Is this, what you are looking for? http://stackoverflow.com/questions/808779/make-a-windows-highlight-search-in-c – Hinek Feb 09 '11 at 09:49
  • It's a programming question. I would have any filepath from filename that I set. – CeccoCQ Feb 09 '11 at 09:49

2 Answers2

2

You'll need the Windows Search SDK.

Edit: Check out the related MSDN docs.

Viral Shah
  • 2,888
  • 2
  • 22
  • 25
1

Here's some sample code, i've used in my univercity project:

DirectoryInfo di = new DirectoryInfo("/some/path");

foreach (FileInfo i in di.GetFiles("filter.text"))
{ 
     // do something
}

Here, /some/path is path where you want to search files and filter.text is filename filter (for example, *.* for all files or *.cpp for .cpp files match. These would match all files or 1.cpp, main.cpp and Main.Project.cpp, respectively).

shybovycha
  • 11,556
  • 6
  • 52
  • 82