06-01-2017 01:37 AM
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...
Solved! Go to Solution.
06-01-2017 08:01 AM
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.
06-01-2017 08:24 AM - edited 06-01-2017 08:31 AM
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.
Martin
06-01-2017 09:40 AM
You still should close every .Net refnum returned in the array after use.
06-01-2017 11:33 PM
Hi Rolf,
thanks a lot, pretty simple 🙂
01-28-2020 10:44 AM
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:
https://learn-cf.ni.com/teach/riodevguide/code/rt_show-available-ip-addresses.html
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.
01-28-2020 03:51 PM
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...
08-24-2020 07:33 PM
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.