Search code examples
c#.netshellsh

How do I create and remove a directory with C#?


I need C# methods are that provides mkdir & rm commands for a file system. Is there any Library?


Solution

  • The cross-platform .Net (formerly .Net Core) library abstracts many of the OS differences including the filesystem.

    See the System.IO namespace and specifically the Directory, DirectoryInfo, File, and FileInfo classes.