How to store/show only ip settings of one ethernet device.
Hello, I'm stuck in this situation: my application must choose one ethernet device, change its ip configuration, do something and then restore previous configuration.
It seems easy but after several tries I've no idea how to solve it.
I tried to use and then with no avail.
I'm thinking about a workaround to store only the ip configuration of that ethernet device but netsh show information of all ethernet devices (and unfortunately in my case are not few).
Maybe the only solution is to store the output of netsh and then parse it ? (Ok but how? Regex?)
My question for you is if there are any other solution to this problem?
Sorry for the question, and thanks in advance.
2 Replies
NetworkInterface.GetAllNetworkInterfaces Method (System.Net.Network...
Returns objects that describe the network interfaces on the local computer.
Thanks a lot, as usual I was looking in a totally wrong direction 🤦🏻♂️