search string in file word,txt,or pdf in my computer disk drive

adjiex_jogja

New member
Joined
Sep 18, 2008
Messages
2
Location
indonesia
Programming Experience
1-3
hello all,1st i'll introduce myself.my name's adji,i'm from indonesia.
i have one question to all members in this forum.
maybe i think anybody can help me.
"we know with google we can search anything. my question, how make program to search string in file word,txt,or pdf.i have logica 1st i must search filetype in my computer.then after i found that files,i will inserted that resource files to listbox.and the last i must open one by one that files to search what i want.anybodys have sourcecode to make this program?please help me..
 
Text files are easy and usually small so you can use code like this to read all text from file and see if it contains the search string:
VB.NET:
If My.Computer.FileSystem.ReadAllText("filepath").Contains("search string") Then
    Me.ListBox1.Items.Add("filepath")
End If
Other file formats are more difficult, for Word you have to use the Office automation libraries, for Pdf you have to find a library that reads this format like SourceForge.net: iTextSharp. For any file type you want to read you need to know its file format or find a library that knows it.
 

Latest posts

Back
Top