Utility - File Search-VBForums
Results 1 to 17 of 17

Thread: Utility - File Search

  1. #1

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Utility - File Search


    NOTE: VERSION 2.0 IS LOCATED HERE

    Title: FileFind
    Description:
    I built this utility as a replacement to the default windows search. It contains the same basic functionality as the windows search. It allows you to search by a whole/part of a file name and/or by as string within a file. It displays the search results in a List View and allows you to export the results to Excel (FYIit uses late binding so Excel is not required to run the Utility).
    Features:
    • Search by all or part of a file name
    • Search by a string within a file
    • Can export results to Excel (FYIit uses late binding so Excel is not
      required to run the Utility)
    • Can open any file found
    • Can open the directory of any file found
    • Allows you to pause/resume the search
    • Allows you to cancel the search
    • Optional Get a count of how many times a string appears within the found file
    • Optional Search case sensitive
    • Optional Include Sub folders in search

    Screen Shots:


    Author: Sean Lodespoto A.K.A ProphetBeal
    System Requirements:
    • This code was written in VB.Net 2003 (V 1.1), so to view the code you need that version or above
    • To use the executable you need at minimum the .Net Framework Version 1.1

    License Info:
    You can use my Utility or parts of the code where ever you want, but GIVE CREDIT WHERE ITS DUE.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by ProphetBeal; Mar 20th, 2009 at 12:50 PM.

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    2,443

    Re: Utility - File Search

    Looks awesome. Tried to run a simple search and got the following error:


    "cmdBeginSearch_Click Error: Cross-thread operation not valid: Control 'stbSearchInfo' accessed from a thread other than the thread it was created on."


    I ran it in 2008 Express. Should that make any difference?

    Thanks!

    Bryce

  3. #3

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Re: Utility - File Search

    I'm not quite sure why you are getting that error. There could be an issue that the 3.5 framework imposes more security than the 1.1. I'll have to take a look at this, when I get a chance. The example I provided above is pretty old and actually I forgot it was even here, so I'll update it soon.

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    2,443

    Re: Utility - File Search

    Appreciate it, man. Thanks!

    Like your website, btw!

  5. #5

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Re: Utility - File Search

    I have made some changes to this code and in fact the application overall.

    The main layout is still the same however most of the code has been replaced.

    Main Updates:
    • Has been built against the 3.5 framework in VS 2008
    • The Excel Export feature no longer uses late binding.
    • Allowed multi threading of search and form
    Attached Files Attached Files

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  6. #6
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    2,443

    Re: Utility - File Search

    Excellent, thanks!

    I'll check it out!

  7. #7
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    2,443

    Thumbs up Re: Utility - File Search

    Beal,

    I had to add a COM reference to "Microsoft Excel 10.0 Object Library." After doing so, it worked great!

    It is much faster than the search apps I've been toying with, so thanks!

    Mind if I steal shamelessly from your code?!

    Bryce

  8. #8

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Re: Utility - File Search

    If I minded...I wouldn't have posted it

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  9. #9
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Utility - File Search

    Beal

    Man, 1394 views of original code and you only have 65+ rep points?
    That blows !
    Here is at least 1 more
    Nice work.

    Spoo

  10. #10
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Question Re: Utility - File Search

    Hey ProphetBeal thanks for the Software, works great

    I've managed to blend it in with a program i wrote and have stumbled across a few questions you might be able to help me with.

    1) can i change the search criteria so that it only searches through files that have extension *.lst. I've done this for my program but i have no idea where to start editing your code, i'm self taught

    2) Can i modify the "Right click" menu of each item found. i.e. i want to disable export to excel and maybe add a custom feature.

    3) Can i modify the "double click" routine so that it copies the file name to another textbox on my program. ie: if i find file....C:\MyFolder\TF12345.lst i want to store "12345" in a text box on my form for later use.

    4) For some reason the status bar at the bottom wont display the current status. All i did was copy it directly from your form to mine and made sure i have all relevent code in the background. It looks as though the "tooltips" and "statustext" are being changed properly but not displaying. Any ideas how or why this could happen?

    5) How would you like me to Credit all your great efforts in providing this code for us not so clever to use Have u got a sig or pic or anything? So far i've added your name to the "aboutbox" in my program.

    Well i know thats a lot of questions so i dont expect u to answer them all at once or even answer all of them, so having said any help is much, much appreciated.

    Thanks

    John

  11. #11

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Re: Utility - File Search

    Quote Originally Posted by ja2984 View Post
    1) can i change the search criteria so that it only searches through files that have extension *.lst. I've done this for my program but i have no idea where to start editing your code, i'm self taught
    In my app there is a text box for just that purpose. The control name is "txtFileName" and it's labeled on the form as "All or part of the file name:"
    Quote Originally Posted by ja2984 View Post
    2) Can i modify the "Right click" menu of each item found. i.e. i want to disable export to excel and maybe add a custom feature.
    You need to edit the "cmnOpenResults" context menu control
    Quote Originally Posted by ja2984 View Post
    3) Can i modify the "double click" routine so that it copies the file name to another textbox on my program. ie: if i find file....C:\MyFolder\TF12345.lst i want to store "12345" in a text box on my form for later use.
    Sure, that would be done in the "lsvFilesFound_DoubleClick" Sub
    Quote Originally Posted by ja2984 View Post
    4) For some reason the status bar at the bottom wont display the current status. All i did was copy it directly from your form to mine and made sure i have all relevent code in the background. It looks as though the "tooltips" and "statustext" are being changed properly but not displaying. Any ideas how or why this could happen?
    I can't really say why this isn't working. If your app isn't multi-threaded correctly that could have something to do with it (IE the screen isn't getting refreshed because the thread is busy).

    If you want more with this issue I suggest creating a thread in the VB.NET forums and post some of your code there.
    Quote Originally Posted by ja2984 View Post
    5) How would you like me to Credit all your great efforts in providing this code for us not so clever to use Have u got a sig or pic or anything? So far i've added your name to the "aboutbox" in my program.
    A note at the top of your code with my name and a link to this thread would be more than enough.

    I hope these answers helped.

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  12. #12
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Re: Utility - File Search

    Thanks ProphetBeal, i'll have a look into the answers and see if i cant nut out what i need.

    I'll do dome more research on why my status bar is not working, basically what u said about the thread being busy went over my head (giraffes fart) hehe.

    I'll add your details and link to my code and about form.

    Thanks once again,

    John.

  13. #13
    New Member
    Join Date
    Apr 2010
    Posts
    3

    Re: Utility - File Search

    Hello ProphetBeal, your software is great !
    I've seen some problems when using this latter :

    - In the first textbox ("A word or phrase within the file") : the software finds some fakes results (the word that I choose isn't in the PDF Files).

    - In the second textbox ("All or part of the file name") : so as to find a file, I have to put an * just before and after my search.

    How to resolve these problems ?

    Thank you so much.

    Julien.

  14. #14

    Thread Starter
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    420

    Re: Utility - File Search

    Quote Originally Posted by AsyLuM View Post
    - In the first textbox ("A word or phrase within the file") : the software finds some fakes results (the word that I choose isn't in the PDF Files).
    It scans the binary versions of the files, so I will bet if you use Notepad to open the PDF in question and search for that text it will find it. I'm not really sure how to avoid this. Any suggestions are welcome.

    Quote Originally Posted by AsyLuM View Post
    - In the second textbox ("All or part of the file name") : so as to find a file, I have to put an * just before and after my search.
    Not sure what the issue here is. Are you saying you don't like using "*"? The built in windows searches use a similar methodology "*.pdf" will only search PDF files.

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  15. #15
    New Member
    Join Date
    Apr 2010
    Posts
    3

    Re: Utility - File Search

    Using "*" is not a problem.

    Indeed, when I try to open PDF files with notepad, it shows me some misunderstanding thing like this,"Oaնjyȍnr*". And , by chance, there is the letters association I'm looking for but not really the word.

    I'm sorry but I can't help you to improve your software.

  16. #16
    New Member
    Join Date
    Apr 2010
    Posts
    3

    Re: Utility - File Search

    Hi ProphetBeal,

    according to the PDF file problems, I've find the code of stanav ! ( add reference : itextsharp.dll (the 4.0.1 works better than the last with my VS2008) and SharpZipLib.dll)

    This latter finds the text in the PDF and puts it in a string value.

    Can you tell me how to adapt it to your code ?

    Thank you.

    PS : Sorry for my bad english.

    Julien.
    Last edited by AsyLuM; Apr 23rd, 2010 at 12:53 AM.

  17. #17
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    292

    Re: Utility - File Search

    HI!

    How can i modify the code to search files by it's extension when the folder options are set to hide the file extension??

    thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.