mount/unmount network drive samba in C#

Viewed 40

i'm trying to connect network drives (with credential) would there be a native C# recent method to achieve this?

            try
        {
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_MappedLogicalDisk");


            foreach (ManagementObject drive in searcher.Get())
            {

                // WriteLine(drive["Provider"]); // Get Path drive
                // WriteLine(drive["DeviceID"]); // Get Letter drive

                moutn/unmount ? ? 


            }
        }
        catch (Exception e2){WriteLine (e2); throw;}

Thanks a lot !

0 Answers
Related