Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Search Emulation


  • Please log in to reply
7 replies to this topic

#1 heltune

heltune

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:11:12 AM

Posted 06 September 2008 - 10:58 AM

hello...

please help me... i am making a project in VB... i want to emulate windows search mode... where a user can type any text on the textbox and then a command button when clicked will search the text input.... my form has one command button, a textbox, and a listbox where the search will be placed there if found if not found a msgbox will prompt saying "file not found" with a retry button. in the form also there is the output textbox where when the search is found will reflect the file that am im searching for and be able to open it... i am planning on searchin .doc, .ppt and .xls file types only... how can i do it?
plaese help me... thank you...

by the way i want the search be like of windows search style where users can input any text on the textbox and able to find the nearest string as possible as it could be... just like the windows search style..
god bless and ty!!!

BC AdBot (Login to Remove)

 


m

#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:12 AM

Posted 06 September 2008 - 11:38 AM

-Recursively traverse all directories on your system to create a list of all files ending with a .doc, .ppt, and .xls extension.
-Iterate through the list of files, and one at a time, search for the desired text.
-If the text is found, add the name of a file to another list.
-Once all of the files have been searched, display a list of files.

input any text on the textbox and able to find the nearest string as possible

Employ a fuzzy-logic algorithm that uses a custom inference engine to as closely match strings as you desire.

I think that about sums it up. You would probably have a much easier time leveraging the Windows Search API instead of trying to do everything on your own.

#3 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:11:12 AM

Posted 06 September 2008 - 02:36 PM

is it possible that i can use a string search for example i want to search the fiilename "Agenda.doc" but i want to put in the textbox search area only "agend"... so my command button will search for all strings nearest to "agend" input... is it possible? ... all the results will be listed/reflected on the listbox area where i can either double click it to open (with regards to shell execute) or push another command button to open it... sorry for being pushy... thank you...

it seems that i can only find the file where i have to put the whole filename string.. that is "agenda.doc" not "agend" or any other strings... i have to complete in short the name... it can't find the name but i know that i have the file... god bless...

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:12 AM

Posted 06 September 2008 - 02:42 PM

Sure. Instead of looking for an exact file name, you need to llok for a file name that contains the string.

This code should be helpful
Dim s As String


' To determine if a string contains a substring,
' check for the return value of 0.
searchStr = "abc"
If InStr(s, searchStr) = 0 Then
	Print "substring not found within s"
End If

Snagged from here.

#5 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:11:12 AM

Posted 07 September 2008 - 12:46 AM

it works but only to some strings i mean u really have to put at least the whole file name strings.... i also tried some examples found on the net for this kind of a project... i found one but the problem is yes it was able to search my input strings for example i was looking for "agenda.doc" in a specific directory but the sample project was able to search other filenames that is unrelated to what i am looking for (or my input string). to make the story short... if ur familiar with windows search utility (where u press F3) i want to emulate/copy at least its functionality... (can u give me an example or a simple project? where can i get that ??)

(if u may can u give me a step by step procedure just like what "Romeo29" did when he helped me with filelistbox, dirlistbox, and drivelistbox... i am sorry for comparing but i admit im a newbie when it comes to programming... sori and thank you..)

thank you... god bless... po!

Edited by heltune, 07 September 2008 - 12:50 AM.


#6 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:11:12 AM

Posted 07 September 2008 - 12:00 PM

i tried everything it seems that my try outs all comes up to one thing only... i can search file extensions such as using wildcards (.doc, or .ppt etc) i also can search the whole filename where the input is on my text1 box like "agenda.doc" i have to complete the whole name with extensions!!! hahayz ... i only want a search mode style to be like of windows... where users can input on the text box any strings such as "agend" or "age" where when i click the command button to search the file what im looking for (im looking for agenda.doc) and the results will be reflected on the list box (the reflected result will be of course near or at least nearest to what i have put on the text box)... is it really possible to emulate windows search engine? i hope someone will help me... a step by step process...

thank you po!

#7 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:12 AM

Posted 07 September 2008 - 12:19 PM

i hope someone will help me... a step by step process...


I hope you are not serious. I have my own work to do, and there is just not enough time to for me, or any one else, to teach you how to program, how to use the proper syntax, and how to execute the program. This is not a simple case of throwing together a few lines of code. You are trying to write a very sophisticated, very complex program that will take many days and weeks to do on your own. The Windows Search uses complex algorithms that, unless you have studied computational theory, you are not going to be able to emulate.

is it really possible to emulate windows search engine?

Yes, but why? You type a word in a box, and hit enter. How much more simple can one get? If I wanted to emulate it, I would simply use the Windows Search API to use the libraries that already exist. I already gave you the link to those.

#8 heltune

heltune
  • Topic Starter

  • Members
  • 59 posts
  • OFFLINE
  •  
  • Local time:11:12 AM

Posted 09 September 2008 - 12:05 AM

thank you for the help .. i read all your suggestion and i found the answer ... thank you po... and sorry fir being pushy,,.. anyway.... GOD bless




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users