private GetVolumeNameForVolumeMountPoint ( string volumeName, StringBuilder uniqueVolumeName, uint uniqueNameBufferCapacity ) : bool | ||
volumeName | string | |
uniqueVolumeName | StringBuilder | |
uniqueNameBufferCapacity | uint | |
Результат | bool |
/// <summary> /// Initializes a new instance of the VolumeDeviceClass class. /// </summary> public VolumeDeviceClass() : base(new Guid(Native.GUID_DEVINTERFACE_VOLUME)) { foreach (string drive in Environment.GetLogicalDrives()) { StringBuilder sb = new StringBuilder(1024); if (Native.GetVolumeNameForVolumeMountPoint(drive, sb, (uint)sb.Capacity)) { _logicalDrives[sb.ToString()] = drive.Replace("\\", ""); } } }