title: Extracting from your resources VB.net
body: <p>I have a .zip folder in the .exe resources and I have to move it out and then extract it to a folder. Currently I am moving the .zip out with System.IO.File.WriteAllByte and unziping it. Is there anyway to unzip straight from the resources to a folder?</p>
  
  <pre><code>    Me.Cursor = Cursors.WaitCursor
      'Makes the program look like it's loading.
  
      Dim FileName As FileInfo
      Dim Dir_ExtractPath As String = Me.tb_Location.Text
      'This is where the FTB folders are located on the drive.
  
      If Not System.IO.Directory.Exists("C:\Temp") Then
          System.IO.Directory.CreateDirectory("C:\Temp")
      End If
      'Make sure there is a temp folder.
  
      Dim Dir_Temp As String = "C:\Temp\Unleashed.zip"
      'This is where the .zip file is moved to.
  
      Dim Dir_FTBTemp As String = Dir_ExtractPath &amp; "\updatetemp"
      'This is where the .zip is extracted to.
  
      System.IO.File.WriteAllBytes(Dir_Temp, My.Resources.Unleashed)
      'This moves the .zip file from the resorces to the Temp file.
  
      Dim UnleashedZip As ZipEntry
      Using Zip As ZipFile = ZipFile.Read(Dir_Temp)
          For Each UnleashedZip In Zip
              UnleashedZip.Extract(Dir_FTBTemp, ExtractExistingFileAction.DoNotOverwrite)
          Next
      End Using
      'Extracts the .zip to the temp folder.
  </code></pre>