Tag Archives: find files

Find files in the startup directory in C#

In some programs you may want to find files that were installed with the program. One way to do that is to put the files in the program’s installation directory. Open the Project menu, select Add Existing Item, find the … Continue reading

Posted in directories, files | Tagged , , , , , , , , , , , , | Leave a comment

Find files that match multiple patterns in C#

The System.IO.Directory.GetFiles method lets you easily search for files in a directory that match a pattern. Unfortunately it can only search for files that match a single pattern. For example, if you want to find files that match the patterns … Continue reading

Posted in .NET, files | Tagged , , , , , , , , , , , , , , | 2 Comments

Find, open, and replace text in files in C#

The example Find files and replace text in them in C# shows how you can find and replace text in files. This example modifies that one to let you open the files you find by double clicking on them in … Continue reading

Posted in directories, files, tools | Tagged , , , , , , , , , , , , , | Leave a comment

Find files and replace text in them in C#

This program lets you recursively find files in a directory hierarchy that match one or more patterns. You can then replace text in those files with new text. Both the Find and Find & Replace buttons call the SearchForFiles method. … Continue reading

Posted in directories, files, tools | Tagged , , , , , , , , , , , | 1 Comment