日期:2014-05-17 浏览次数:20832 次
?
?
WinSearchFile is a program that I developed and I usually use it to search files on my PC.
Sometimes the search engine integrated with Explorer doesn't work fine, especially when I try to find text contained into files, so I decided to build my own search program.
There are a lot of search programs available to install on your PC but this one, without indexing your data, is simple and fast enough to help you in your search.
WinSearchFile layout is simple and quite similar to the Explorer integrated search. It is possible to write a pattern search (wildcards admitted) and/or a text to search into file contents (you can also decide for a case sensitive search).
In the "look in" area, you have all the disks of your computer (network connection included). To obtain this list, I use the DiskCollection
class developed by dmihailescu
in his Get Logical Drives Information
article.
/// < SUMMARY > /// Add items for all floppy, /// CD and hard drives. /// < / SUMMARY > private void LoadDisksComboBox() { disksListBox.Items.Clear(); // Try to use DiskCollection // retrieving drive information DiskCollection diskColl = new DiskCollection(); if ( diskColl.Load() ) { foreach (DiskCollection.LogicalDriveInfo diskinfo in diskColl) { disksListBox.Items.Add(diskinfo.Name.ToString() + " : " + diskinfo.Description ); } } else { // otherwise build a drive list checking // if a root directory exists for (char Ch = ' A' ; Ch <= ' Z' ; Ch++) { string Dir = Ch + @" :\" ; if (Directory.Exists(Dir))