❔ 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
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
3 Replies
Core Dream Studios
ty
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.