C# Directory File Read

public class FileManager
{
public static void ReadFilesFromDirectory(string path, string searchPattern)
{
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] files = di.GetFiles();
foreach (var item in files)
{
Console.WriteLine(item.Name );
}
}
}
}
using DirectoryFileOperation;
FileManager.ReadFilesFromDirectory(AppDomain.CurrentDomain.BaseDirectory, "*");
Console.ReadLine();
view raw 2.Program.cs hosted with ❤ by GitHub
DirectoryFileOperation.deps.json
DirectoryFileOperation.dll
DirectoryFileOperation.exe
DirectoryFileOperation.pdb
DirectoryFileOperation.runtimeconfig.json
view raw 3.Output hosted with ❤ by GitHub

Yorumlar