Beispiel #1
0
        private void bgwMain_DoWork(object sender, DoWorkEventArgs e)
        {
            object[] args = (object[])e.Argument;
            string filePath = (string)args[0];
            bool resolveChain = (bool)args[1];

            DataTable dt = new DataTable();
            dt.Columns.Add("Item");
            dt.Columns.Add("Value");

            dt.Rows.Add("Source", filePath);

            try
            {
                if (resolveChain)
                {
                    using (Disk disk = new Disk(filePath))
                    {
                        DumpHeader((DiscUtils.Ewf.Section.Header2)disk.GetSection("header"), dt);
                        DumpVolume((DiscUtils.Ewf.Section.Volume)disk.GetSection("volume"), dt);
                        dt.Rows.Add("Segments", disk.Files.Count);
                    }
                }
                else
                {
                    EWFInfo ewfInfo = new EWFInfo(filePath);
                    DumpHeader(ewfInfo.HeaderSection, dt);
                    DumpVolume(ewfInfo.VolumeSection, dt);
                }
            }
            //catch (Exception ex)
            catch(Exception ex)
            {
                dt.Rows.Add("Error", ex.Message);
                if (ex.InnerException != null)
                    dt.Rows.Add("More Info", ex.InnerException.Message);
            }

            e.Result = dt;
        }