I'm trying to port an old VB application to C#, but I cannot find any methods in C# that do the same as the following two methods.
Dim wshNetwork As New IWshNetwork_Class
Do you know the .NET equivalent to the WshNetwork object?
.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();
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.
Dig Deeper on C# programming language
Related Q&A from Daniel Cazzulino
Here our experts address how to converti a VB Windows application to a VB .NET Web application. Continue Reading