EXPERT RESPONSE
.NET provides native support for COM components. You can add a reference to the DLL you're using actually and use it directly from your C# code. Therefore, once you have the library referenced, you could use:
IWshNetwork_Class wshNetwork = new IWshNetwork_Class();
wshNetwork.RemoveNetworkDrive();
wshNetwork.MapNetworkDrive();
I have never used this library, so I'm not sure if the parameters are correct or the type to be created is the right one, but you get the idea.
Additional options and info on how to achieve this were discussed in the csharp newsgroup. Read the comments here: http://www.dotnet247.com/247reference/msgs/11/56914.aspx.
|