Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
GeneralRe: find files Pin
musefan29-May-09 3:05
musefan29-May-09 3:05 
GeneralRe: find files Pin
michaelgr129-May-09 3:17
michaelgr129-May-09 3:17 
GeneralRe: find files Pin
musefan29-May-09 3:20
musefan29-May-09 3:20 
GeneralRe: find files Pin
michaelgr129-May-09 3:23
michaelgr129-May-09 3:23 
GeneralRe: find files Pin
michaelgr129-May-09 3:25
michaelgr129-May-09 3:25 
GeneralRe: find files Pin
musefan29-May-09 3:32
musefan29-May-09 3:32 
GeneralRe: find files Pin
michaelgr129-May-09 3:50
michaelgr129-May-09 3:50 
GeneralRe: find files Pin
WinSolution29-May-09 4:31
WinSolution29-May-09 4:31 
Just open visual studio 2005 / latest

add

one button (to intiate click event ),
one textbox (contains expression you want to search ),
and one listbox to show the results

add click event on Button1 by double clicking on it and paste following code

//replace mine path with your own
DirectoryInfo DirInfo = new DirectoryInfo(@"F:\Documents and Settings\Administrator\My Documents\");

FileInfo[] DirFiles = DirInfo.GetFiles(textBox1.Text, SearchOption.AllDirectories);
listBox1.Items.Clear();
foreach (FileInfo FileObj in DirFiles)
{
listBox1.Items.Add(FileObj);
}

goto top of file and add a namespace >> using System.IO;

press F5 and run

insert expression to search. click on button. result will be displayed to list box.

if this doesnot work the provide me email address i will mail my project to you
GeneralRe: find files Pin
I Believe In GOD29-May-09 4:51
I Believe In GOD29-May-09 4:51 
GeneralRe: find files Pin
michaelgr129-May-09 6:06
michaelgr129-May-09 6:06 
GeneralRe: find files Pin
michaelgr129-May-09 6:14
michaelgr129-May-09 6:14 
GeneralRe: find files Pin
WinSolution29-May-09 6:41
WinSolution29-May-09 6:41 
GeneralRe: find files Pin
michaelgr129-May-09 6:53
michaelgr129-May-09 6:53 
GeneralRe: find files Pin
WinSolution29-May-09 6:59
WinSolution29-May-09 6:59 
GeneralRe: find files Pin
michaelgr129-May-09 7:15
michaelgr129-May-09 7:15 
GeneralRe: find files Pin
michaelgr129-May-09 7:52
michaelgr129-May-09 7:52 
GeneralRe: find files Pin
WinSolution29-May-09 6:57
WinSolution29-May-09 6:57 
Questionsql server 2000 DataBase Backup Pin
Yathish hatter29-May-09 2:16
Yathish hatter29-May-09 2:16 
AnswerRe: sql server 2000 DataBase Backup Pin
Manas Bhardwaj29-May-09 2:25
professionalManas Bhardwaj29-May-09 2:25 
AnswerRe: sql server 2000 DataBase Backup Pin
Satish Pai29-May-09 2:36
Satish Pai29-May-09 2:36 
AnswerRe: sql server 2000 DataBase Backup Pin
I Believe In GOD29-May-09 2:50
I Believe In GOD29-May-09 2:50 
QuestionHow to know when a Message Box has been shown for a form? Pin
The NULL Developer29-May-09 1:52
professionalThe NULL Developer29-May-09 1:52 
QuestionRe: How to know when a Message Box has been shown for a form? Pin
Rajesh R Subramanian29-May-09 1:57
professionalRajesh R Subramanian29-May-09 1:57 
AnswerRe: How to know when a Message Box has been shown for a form? Pin
The NULL Developer29-May-09 2:12
professionalThe NULL Developer29-May-09 2:12 
GeneralRe: How to know when a Message Box has been shown for a form? Pin
Rajesh R Subramanian29-May-09 2:24
professionalRajesh R Subramanian29-May-09 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.