Esempio n. 1
0
 private long GetClusterSize(string diskPath)
 {
     long clusterSize = 0;
     DiskInfo diskInfo = new DiskInfo();
     diskInfo = GetDiskInfo(diskPath);
     clusterSize = (diskInfo.BytesPerSector * diskInfo.SectorsPerCluster);
     return clusterSize;
 }
Esempio n. 2
0
        private DiskInfo GetDiskInfo(string rootPathName)
        {
            DiskInfo diskInfo = new DiskInfo();
            int sectorsPerCluster = 0, bytesPerSector = 0, numberOfFreeClusters = 0, totalNumberOfClusters = 0;
            GetDiskFreeSpace(rootPathName, ref sectorsPerCluster, ref bytesPerSector, ref numberOfFreeClusters, ref totalNumberOfClusters);

            diskInfo.SectorsPerCluster = sectorsPerCluster;
            diskInfo.BytesPerSector = bytesPerSector;

            return diskInfo;
        }