title: How to overwrite extracted zip file in C#, WinForms?
body: <p>I have this code that backup and restore in C# using MS Access as its database. I finished doing the backup in zip format and now I want to restore the Zipped file. Any help will be much appreciated. </p>
  
  <pre><code>public void BackupDatabase(string dateToday)
      {
  
          string dbFileName = "dbCPS.accdb";
              string CurrentDatabasePath = Path.Combine(Environment.CurrentDirectory , dbFileName);
              string backTimeStamp = Path.GetFileNameWithoutExtension(dbFileName) + "_" + dateToday + ".zip";// +Path.GetExtension(dbFileName);
              string destFileName = backTimeStamp;// +dbFileName;
              FolderBrowserDialog fbd = new FolderBrowserDialog();
              if (fbd.ShowDialog() == DialogResult.OK)
              {
                  string PathtobackUp = fbd.SelectedPath.ToString();
                  destFileName = Path.Combine(PathtobackUp, destFileName);
  
                  //File.Copy(CurrentDatabasePath, destFileName, true);
                  using (var zip = new ZipFile())
                  {
                      zip.AddFile(dbFileName);
                      zip.Save(destFileName);
                  }
                  MessageBox.Show("Backup successful! ");                  
              }            
      }
  
  private void backupToolStripMenuItem1_Click(object sender, EventArgs e)
      {            
          BackupDatabase(DateTime.Now.ToString("ddMMMyyyy_HH.mm"));
      }
  
  
  public void RestoreDatabase(string restoreFile)
      {
          string dbFileName = "dbCPS.accdb";
          string pathBackup = restoreFile;
          string CurrentDatabasePath = Path.Combine(Environment.CurrentDirectory, dbFileName);
          File.Copy(pathBackup, CurrentDatabasePath, true);
          MessageBox.Show("Restore successful! "); 
      }
  
  private void restoreToolStripMenuItem_Click(object sender, EventArgs e)
      {
          try
          {                
              openFileDialogBackUp.FileName = "dbCPS";
              openFileDialogBackUp.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + @"Sauvegardes";
              if (openFileDialogBackUp.ShowDialog() == DialogResult.OK)
                  RestoreDatabase(openFileDialogBackUp.FileName);
          }
          catch (Exception error)
          {
              MessageBox.Show(error.ToString());
          }
      }
  </code></pre>
  
  <p>This code extracts the zipped file but I dont know how to do the restore at the same time.</p>
  
  <pre><code>        using (ZipFile zip = ZipFile.Read(restoreFile))
          {
              zip.ExtractAll(CurrentDatabasePath);
          }
  </code></pre>