steam Game Verifier using RAR files

80 Views Asked by At

I am backing up my Steam games in RAR files The point is to verify offline L4D2 game

I wish to read each entry in the rar file then check to see if it exists

but I am getting this error

System.IO.InvalidDataException: Split or spanned archives are not supported. at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()

using System;
using System.IO;
using System.IO.Compression;

    private void btn_ReadfromZipfile_Click(object sender, EventArgs e)
        {
            DialogResult result = file.ShowDialog();
            if (result == DialogResult.OK)
            {
                string txtArchiveName = Path.GetFullPath(Path.Combine(Application.StartupPath, file.FileName));
              

                using (ZipArchive zip = ZipFile.OpenRead(txtArchiveName))
                {
             
                        // Loop through the archive's files.
                        foreach (ZipArchiveEntry entry in zip.Entries)
                        {
                        // if(zip_entry.);                                                          
                        listBox1.SelectedItems.Add(entry.FullName);
                        CheckFileExists(entry.FullName);
                        }
                }
            }
        }

1

There are 1 best solutions below

0
dwk On

Am changing to ZIP files and using this Ionic

using Ionic.Zip;

 private void btn_ReadfromZipfile_Click(object sender, EventArgs e)
        {
            DialogResult result = file.ShowDialog();
            if (result == DialogResult.OK)
            {
                string txtArchiveName = Path.GetFullPath(Path.Combine(Application.StartupPath, file.FileName));
               // MessageBox.Show(txtArchiveName);
                try
                {

                    using (ZipFile zip = ZipFile.Read(txtArchiveName))
                    {

                        // Loop through the archive's files.
                        foreach (ZipEntry entry in zip)
                        {
                            // if(zip_entry.);                                                          
                            listBox1.TopIndex = 
                            listBox1.Items.Add(entry.FileName); 
                            listBox1.SelectedItems.Add(entry.FileName);
                            // CheckFileExists(entry.FullName);
                           
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error extracting archive.\n" + ex.Message);
                }
            }  
        }

This works ... just have redone 555 games Thanks for your Answers