title: Microsoft.VisualBasic.FileIO.FileSystem equivalence in C#
body: <p>I use VS 2008, .net 3.5, C# projects. I need do the same functionally like Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory.</p>
  
  <p>Anyone says referencing the Microsoft.VisualBasic is often undesirable from within C#. Any association with VB from within C# code strikes me as undesirable. </p>
  
  <p>Using FileSystem class, this is a perfectly fine solution, but I prefer not references Microsoft.VisualBasic library. That one I would avoid. </p>
  
  <pre><code>     private static void DeleteDirectory(string destino)
              {
      //UIOption Enumeration. Specifies whether to visually track the operation's progress. Default is UIOption.OnlyErrorDialogs. Required.
  
      //RecycleOption Enumeration. Specifies whether or not the deleted file should be sent to the Recycle Bin. Default is RecycleOption.DeletePermanently.
  
      //UICancelOption Enumeration. Specifies whether to throw an exception if the user clicks Cancel. Required.
                  Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory(destino, 
  Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, 
  Microsoft.VisualBasic.FileIO.RecycleOption.DeletePermanently, 
  Microsoft.VisualBasic.FileIO.UICancelOption.ThrowException);
                  //Directory.Delete(destino, true);
              }
  </code></pre>
  
  <p>Other samples:
  <a href="https://stackoverflow.com/questions/17612/how-do-you-place-a-file-in-recycle-bin-instead-of-delete">How do you place a file in recycle bin instead of delete?</a></p>
  
  <pre><code>Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(file.FullName,
      Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs,
      Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin);
  </code></pre>