title: "net use * /delete" equivalent in C#?
body: <p>I'm using the following lines below to create a connection to a shared network location, but the problem is with any connections active (I think), <code>network.MapNetworkDrive("..")</code> will throw an error:</p>
  
  <blockquote>
    <p>Multiple connections to a server or shared resource by the same user,
    using more than one user name, are not allowed. Disconnect all previous 
    connections to the server or shared resource and try again.</p>
  </blockquote>
  
  <p>I got pass this error by using <code>net use * /delete</code> from the command line, but is there an equivalent commands in C#?</p>
  
  <pre><code>IWshNetwork_Class network = new IWshNetwork_Class();
  network.MapNetworkDrive("z:", @shared_path, Type.Missing, "Admin", "!QAZxsw2");
  
  
  ...
  
  network.RemoveNetworkDrive("z:");          
  </code></pre>