P Phil Wilson Jun 10, 2005 #2 Not directly in framework classes AFAIK, but here's a way: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet07232002.asp There's probably a WMI way too if you know the magic incantation SQL query.
Not directly in framework classes AFAIK, but here's a way: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet07232002.asp There's probably a WMI way too if you know the magic incantation SQL query.
W Willy Denoyette [MVP] Jun 10, 2005 #3 Chuck Walters said: Is there a .net API to get the "Volume Name" of a given drive? Click to expand... Use System.Management and WMI's class "Win32_LogicalDisk, something like this will do... using System.Management; ... string drive= "c:"; string VolumeLabel = null; string ObjectPath = String.Format("win32_LogicalDisk.DeviceId='{0}'", drive); using(ManagementObject mo = new ManagementObject(ObjectPath )) { mo.Get(); VolumeLabel = mo["VolumeName"]; } Willy.
Chuck Walters said: Is there a .net API to get the "Volume Name" of a given drive? Click to expand... Use System.Management and WMI's class "Win32_LogicalDisk, something like this will do... using System.Management; ... string drive= "c:"; string VolumeLabel = null; string ObjectPath = String.Format("win32_LogicalDisk.DeviceId='{0}'", drive); using(ManagementObject mo = new ManagementObject(ObjectPath )) { mo.Get(); VolumeLabel = mo["VolumeName"]; } Willy.