首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > windows >

相仿Windows Search的文件搜索系统

2012-09-22 
类似Windows Search的文件搜索系统??IntroductionWinSearchFile is a program that I developed and I usu

类似Windows Search的文件搜索系统

    ?

    ?

    Introduction

    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.

    Inside the application

    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.

    Collapse相仿Windows Search的文件搜索系统 Copy Code

    ?

    In the WinSearchFile application, I use threads to make the same search simultaneously on different targets; I use a thread for each target drive.

    Collapse相仿Windows Search的文件搜索系统 Copy Code

    ?

    Threads use the FileSearch class to do their work. To update controls or data structures on main threads, use delegate functions. I defined a delegate function for the AddListBoxItem method:

    Collapse相仿Windows Search的文件搜索系统 Copy Code
     Collapse相仿Windows Search的文件搜索系统 Copy Code
    Abort method.

    Collapse相仿Windows Search的文件搜索系统 Copy Code

    To quick launch WinSearchFile, you can create a shortcut to it on your desktop and assign to this one a shortcut key.

    相仿Windows Search的文件搜索系统

    ?

    Conclusion

    I hope you enjoy this article.

    New WinSearchFile version

    The new WinSearchFile 2.0, built using Visual Studio 2005 and C# 2.0, contains the following new features:

    Single Instance Application using code written by Eric Bergman-Terrell.Search inside PDF files.Regular expression searching.Searching using IFilter.Max directory visit depth.File Creation Time or Last ACcess Time or Last Write Time searchingdirectory list to search into.Save results button.

    Here is a new screenshot:

    相仿Windows Search的文件搜索系统

    ?

    About IFilter

    User can decide to use installed IFilter to extract plaintext from files. To implement this interface I used 2 class developed by Dan Letecky.

    The following code shows where I try to use IFilter to get plaintext:

    Collapse相仿Windows Search的文件搜索系统 Copy Code

    ?

    License

    This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    About the AuthorMassimo Beatini


    Italy

    ?

    转自:http://www.codeproject.com/KB/files/winsearchfile.aspx

    下载:http://download.csdn.net/source/1790306

热点排行