Map network drive in C#

0 Comments

// Create network drive mapping System.Diagnostics.Process.Start(“net.exe”, @”use K: “”\\my.server.com\Websites\Mail“” /user:MyDomain\admin MySuperSecretPassword”).WaitForExit(); // Remove network drive mapping System.Diagnostics.Process.Start(“net.exe”, @”use K: /delete”).WaitForExit();