C# List All Partitions, Including Microsoft Reserved Partitions -


            managementclass devs = new managementclass(@"win32_diskdrive");             managementobjectcollection moc = devs.getinstances();             foreach (managementobject mo in moc)             {                 uint32 physicaldisknumber = (uint32)mo["index"];                 uint64 disksize = (uint64)mo["size"];                 foreach (managementobject b in mo.getrelated("win32_diskpartition"))                 {                     //b["name"] gives "disk #0, partition #0"                     string[] elems = b["name"].tostring().split(',');                     int partitionnumber = int32.parse(elems[1].replace("partition #", "").trim());                     ulong size = (ulong) b["size"];                  }             } 

this code retrieves partitions on disks. however, not retrieve microsoft reserved partitions. want retrieve partitions on disk, including msr partitions. how can accomplish in c#?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -