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 Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ... Continue Reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers. Continue Reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.