Вопрос по c#, c++ – Как получить информацию о диске по идентификатору тома

6

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

\\?\Volume{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

EDIT:

Error: User Rate Limit Exceeded

UPDATE:

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

ManagementObjectSearcher ms = new ManagementObjectSearcher("Select * from Win32_Volume");    
foreach(ManagementObject mo in ms.Get())   
{
    var guid = mo["DeviceID"].ToString();

    if(guid == myGuid)
        return mo["DriveLetter"];
}
Error: User Rate Limit Exceeded Nikhil Agrawal
Error: User Rate Limit Exceeded user844541

Ваш Ответ

4   ответа
-2

DriveInfo.GetDrives Method

DriveInfo[] allDrives = DriveInfo.GetDrives();

foreach (DriveInfo d in allDrives)
{
    Console.WriteLine("Drive {0}", d.Name);
    Console.WriteLine("  File type: {0}", d.DriveType);
    if (d.IsReady == true)
    {
        Console.WriteLine("  Volume label: {0}", d.VolumeLabel);
        Console.WriteLine("  File system: {0}", d.DriveFormat);
        Console.WriteLine(
            "  Available space to current user:{0, 15} bytes", 
            d.AvailableFreeSpace);

        Console.WriteLine(
            "  Total available space:          {0, 15} bytes",
            d.TotalFreeSpace);

        Console.WriteLine(
            "  Total size of drive:            {0, 15} bytes ",
            d.TotalSize);
    }
}
Error: User Rate Limit ExceededDriveInfoError: User Rate Limit Exceeded
2

"C:"volume GUID path\\?\Volume{XXX}

FindFirstVolumeMountPoint / FindNextVolumeMountPoint / FindVolumeMountPointClose

Error: User Rate Limit Exceeded user844541
Error: User Rate Limit Exceededmsdn.microsoft.com/en-us/library/windows/desktop/…
2

System.Management.ManagementObjectSearcher ms =
new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
foreach (ManagementObject mo in ms.Get())
{
    //Find by ID
}

1

Похожие вопросы