private long GetClusterSize(string diskPath) { long clusterSize = 0; DiskInfo diskInfo = new DiskInfo(); diskInfo = GetDiskInfo(diskPath); clusterSize = (diskInfo.BytesPerSector * diskInfo.SectorsPerCluster); return clusterSize; }
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; }