PDA

Click to See Complete Forum and Search --> : Utility - File Search


ProphetBeal
Feb 28th, 2007, 12:44 PM
NOTE: VERSION 2.0 IS LOCATED HERE (http://www.vbforums.com/showthread.php?p=3475757#post3475757)

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:
http://www.vbforums.com/attachment.php?attachmentid=55030

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.

vbfbryce
Jan 30th, 2009, 10:04 AM
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

ProphetBeal
Feb 9th, 2009, 04:43 PM
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.

vbfbryce
Feb 10th, 2009, 07:19 AM
Appreciate it, man. Thanks!

Like your website, btw!

ProphetBeal
Mar 20th, 2009, 12:46 PM
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

vbfbryce
Mar 23rd, 2009, 07:29 AM
Excellent, thanks!

I'll check it out!

vbfbryce
Mar 24th, 2009, 10:03 AM
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

ProphetBeal
Mar 24th, 2009, 10:21 AM
If I minded...I wouldn't have posted it :D

Spoo
May 8th, 2009, 08:56 PM
Beal

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

Spoo

ja2984
Jun 19th, 2009, 03:28 AM
Hey ProphetBeal thanks for the Software, works great :thumb:

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 :blush:

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:afrog: 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:wave:

ProphetBeal
Jun 19th, 2009, 10:38 AM
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 :blush:

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:"

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

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

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 (http://www.vbforums.com/forumdisplay.php?f=25) forums and post some of your code there.

5) How would you like me to Credit all your great efforts in providing this code for us not so clever to use:afrog: 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. :thumb:

ja2984
Jun 19th, 2009, 08:40 PM
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.

AsyLuM
Apr 22nd, 2010, 01:52 PM
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.

ProphetBeal
Apr 22nd, 2010, 03:16 PM
- 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.

- 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.

AsyLuM
Apr 22nd, 2010, 03:49 PM
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.

AsyLuM
Apr 23rd, 2010, 12:39 AM
Hi ProphetBeal,

according to the PDF file problems, I've find the code (http://www.vbforums.com/showthread.php?t=475759) 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.