Showing results for 
Search instead for 
Did you mean: 

List network interfaces via .net

Go to solution

I try to list the available network adapters over the .net class "NetworkInterface" found in "System.Net.NetworkInformation.NetworkInterface" but the constructor therefore is not available... (see attachment).

I not have a clue what's my mistake here...



0 Kudos
Message 1 of 8
Accepted by DonBorste

It may only contain static methods and therefore has no constructor. Try to place a property node or method node on the diagram and then select from there for this class and you would see all static methods (or attributes) then.

Rolf Kalbermatter
Averna BV
Message 2 of 8

Here is a way to do it,

I used this link and followed the c# example.


Rolf is right, it has no constructor since its static method.




Download All
Message 3 of 8

You still should close every .Net refnum returned in the array after use.

Rolf Kalbermatter
Averna BV
Message 4 of 8

Hi Rolf,


thanks a lot, pretty simple 🙂

0 Kudos
Message 5 of 8

While I search the internet for the same question (well, similar question), I found this forum post. Which I liked but I also got another search result:

I found this other solution to be more straightforward to get a list of all IP address (which is what I was aiming for).


So, if you only need all your IP address, you can use the String to IP VI, you can right-click on it to enable multiple output. This will output an array with all your system's IP.


Anyway, since I hit this forum post first while searching, I figured I'd update it for others that might find this post.

Vincent Carpentier, Ing./Eng.
Neosoft Technologies
DQMH Trusted Advisor
0 Kudos
Message 6 of 8

I'm guessing there was a reason the OP needed to do it through .NET - although, for the life of me, I can't imagine why.  Maybe the OP had no idea how to do it with native LV code, and no one picked up on that...

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8

This .net method works only for connected interfaces.

How to get all connections including those currently not connected interfaces?


I want to present a list of all connections for user to select.


George Zou
0 Kudos
Message 8 of 8