Display directory Learn programming C# Sharp

Lesson:

Additional Libraries


Exercise:

Display directory 12


Objetive:

Create a program to display the files in the current directory


Code:

using System;
using System.IO;
class DisplayDirectory
{
    static void Main()
    {
        string[] files = Directory.GetFiles(".");

        foreach (string file in files)
        {
            Console.WriteLine(file);
        }
    }
}