[Solved] c# searching on C:\Users\John\Desktop using the text on text.box as search key? [closed]


Below should work. It enumerates that path. Be sure to have a multiline textbox called txtOutput, and a txtSearch named control. You can put this in a button click or where ever.

 txtOutput.Text = "";

 foreach(string file in Directory.GetFiles("c:\\path"))
    if(Path.GetFileName(file).Contains(txtSearch.Text))
        txtOutput.Text += txtOutput.Text + file + ", ";

2

solved c# searching on C:\Users\John\Desktop using the text on text.box as search key? [closed]