Listing of Files within a Directory using C#


This tutorial uses a helper object in C# to get a list of the files within a directory/folder. We then use a foreach loop to go through an array to print out the topic.



  1. Hey Great Tutorial
    Now in this it lists all the files right ? What I wanna know is , wheather it is possible to check if a file exist in a given subdirectory.

    Like There is a Main Dir under which has several sub dir . these sub dir are expected to have a certain .config file , I wanna know if there is a way to check i this .config file exist in selected sub dir ?

  2. Is there a way to find the nested directories inside of the current directory and list the files in them too? Also, how hard would it be to recreate this in C? I assume I would have to recreate a lot of these packages and functions


Please enter your comment!
Please enter your name here