[DllImport("kernel32.dll")]
static extern IntPtr FindFirstVolume([Out] StringBuilder lpszVolumeName,
uint cchBufferLength);
None.
None.
Please add some!
public static StringCollection GetVolumes()
{
const uint N = 1024;
StringBuilder volume = new StringBuilder((int)N, (int)N);
StringCollection ret = new StringCollection();
IntPtr volume_handle = FindFirstVolume(volume, N);
do
{
ret.Add(volume.ToString());
} while (FindNextVolume(volume_handle, volume, N));
return ret;
}
Do you know one? Please contribute it!