❔ VB to C# for Moving all folders and files?

Is there a way to do this in C# without relying on Microsoft.VisualBasic.FileIO? Thank you.

Sub MoveAllItems(ByVal fromPath As String, ByVal toPath As String)
        My.Computer.FileSystem.CopyDirectory(fromPath, toPath, True)
        'Here we want to not recycle the files since the files are moved
        My.Computer.FileSystem.DeleteDirectory(fromPath, FileIO.DeleteDirectoryOption.DeleteAllContents)
    End Sub
Was this page helpful?