using System.IO; public class FileSystemExample { public void ReadFileContents(string filepath) { string contents = File.ReadAllText(filepath); Console.WriteLine("The contents of the file are: " + contents); } }
using System.IO; public class FileSystemExample { public void CreateDirectory(string path) { Directory.CreateDirectory(path); Console.WriteLine("Directory created at path: " + path); } }This example shows how to create a new directory using the static method `Directory.CreateDirectory()`. This library is a part of the .NET Standard Library, which is a set of APIs that are available across different platforms and frameworks in the .NET ecosystem.