Feedback

Ermitteln von Netzwerkkarteneigenschaften

Sprache: C#

Ermitteln von Netzwerkkarteneigenschaften
using System.Net.NetworkInformation;

NetworkInterface[] MyInterfaces = NetworkInterface.GetAllNetworkInterfaces();
            
foreach (NetworkInterface Networkcards in MyInterfaces)
{
  Console.WriteLine(Networkcards.GetIPProperties().UnicastAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().GatewayAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().DnsAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().DhcpServerAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().WinsServersAddresses);
}
using System.Net.NetworkInformation;

NetworkInterface[] MyInterfaces = NetworkInterface.GetAllNetworkInterfaces();
            
foreach (NetworkInterface Networkcards in MyInterfaces)
{
  Console.WriteLine(Networkcards.GetIPProperties().UnicastAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().GatewayAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().DnsAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().DhcpServerAddresses);
  Console.WriteLine(Networkcards.GetIPProperties().WinsServersAddresses);
}