Imports System.Net Imports System.Net.NetworkInformation Public Class Form1 Private strEvents As String Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim Interfaces As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces() Dim adapter As NetworkInterface Dim myAdapterProps As IPInterfaceProperties = Nothing Dim myGateways As GatewayIPAddressInformationCollection = Nothing For Each adapter In Interfaces If adapter.NetworkInterfaceType = NetworkInterfaceType.Loopback Then Continue For End If TextBox1.AppendText(adapter.Name & Environment.NewLine) TextBox1.AppendText(adapter.Description & Environment.NewLine) myAdapterProps = adapter.GetIPProperties myGateways = myAdapterProps.GatewayAddresses Dim IPInfo As UnicastIPAddressInformationCollection = adapter.GetIPProperties().UnicastAddresses Dim properties As IPInterfaceProperties = adapter.GetIPProperties() For Each IPAddressInfo As UnicastIPAddressInformation In IPInfo TextBox1.AppendText("IP Address : " & IPAddressInfo.Address.ToString & Environment.NewLine) TextBox1.AppendText("Subnet Mask :" & IPAddressInfo.IPv4Mask.ToString & Environment.NewLine) Next For Each Gateway As GatewayIPAddressInformation In myGateways TextBox1.AppendText("Gateway IP :" & Gateway.Address.ToString & Environment.NewLine) Next TextBox1.AppendText("DNS Address :" & properties.DnsAddresses.ToString & Environment.NewLine) Next End Sub End Class
IPInterfaceProperties.DnsAddresses
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)