private void GetDiskFileAllocationTable()
 {
     DiskStream.Seek(DiskBootSector.FATOffset(), SeekOrigin.Begin);
     byte[] tempFAT = new byte[DiskBootSector.SizeOfFAT() * DiskBootSector.GetBytesPerSector()];
     DiskStream.Read(tempFAT, 0, tempFAT.Length);
     FAT_TABLE = new FileAllocationTable(tempFAT, DiskBootSector);
 }
Пример #2
0
        public FilesystemInformation(BootSector BS, FSInfoSector FSInfo)
        {
            InitializeComponent();
            this.MaximumSize = this.MinimumSize = this.Size;
            BootSector       = BS;
            FSInfoSector     = FSInfo;

            //General
            this.volumeIDLabel.Text = BootSector.GetVolumeID();
            this.volumeLabel.Text   = BootSector.GetVolumeLabel();

            //Boot Sector
            this.labelBPS.Text = BootSector.GetBytesPerSector().ToString();
            this.labelSPC.Text = BootSector.GetSectorsPerCluster().ToString();
            this.labelSectoresReservados.Text = BootSector.GetReservedSectors().ToString();
            this.labelTotalSectores.Text      = BootSector.GetTotalSectoresFAT32().ToString();
            this.labelFATSize.Text            = BootSector.SizeOfFAT().ToString();

            //FSInfo Sector
            this.lastAllocatedCluster.Text = FSInfoSector.GetLastAllocatedCluster().ToString();
            this.freeClusters.Text         = FSInfoSector.GetFreeClusterCount().ToString();

            //File Allocation Table
            fatSize.Text    = BootSector.SizeOfFAT().ToString();
            fat1Offset.Text = BootSector.FATOffset().ToString();
            fat2Offset.Text = BootSector.FAT2Offset().ToString();
        }
 private void GetDiskBootSector()
 {
     DiskStream.Seek(0, SeekOrigin.Begin);
     byte[] bTemp = new byte[512];
     DiskStream.Read(bTemp, 0, 512);
     DiskBootSector = new BootSector(bTemp);
     DiskBootSector.FATOffset();
     DiskBootSector.SectorOffsetForCluster(4);
 }