[DllImport("kernel32.dll")]
static extern bool SetVolumeMountPoint(string lpszVolumeMountPoint,
string lpszVolumeName);
None.
None.
Please add some!
StringBuilder sb = new StringBuilder(1024);
VolumeFunctions.GetVolumeNameForVolumeMountPoint("C:\\", sb, sb.Capacity);
richTextBox1.Text = sb.ToString() + "Test";
VolumeFunctions.SetVolumeMountPoint(@"W:\", @"\C:\Test");
richTextBox1.AppendText(Win32Exception(Marshal.GetLastWin32Error()).ToString());
public class VolumeFunctions
{
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern bool GetVolumeNameForVolumeMountPoint(
string volumeName,
StringBuilder uniqueVolumeName,
int uniqueNameBufferCapacity);
[DllImport("kernel32.dll")]
internal static extern bool SetVolumeMountPoint(string lpszVolumeMountPoint,
string lpszVolumeName);
}
Do you know one? Please contribute it!