The following example shows how to retrieve all the text files from a directory and move them to a new directory. After the files are moved, they no longer exist in the original directory.

The following example demonstrates how to use the M:System.IO.Directory.EnumerateFiles(System.String) method to retrieve a collection of text files from a directory, and then use that collection in a query to find all the lines that contain “Example”.

The following example demonstrates how to move a directory and all its files to a new directory. The original directory no longer exists after it has been moved.


This entry was posted in C#. Bookmark the permalink.

Leave a Reply