W
witcher7
Guest
Hello,
I hope you can help me. I got 2 questions :
2. How can I show the DNS address in this code and the names like "LAN-Connection 3" ?
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
RichTextBox1.Clear()
For Each adapter In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim IpAddress As UnicastIPAddressInformation
For Each IpAddress In adapter.GetIPProperties.UnicastAddresses
' ?????????????????????????????????? Get names ???????????????????????????????????
' Get IP and Subnet information
RichTextBox1.AppendText("IP Addresse : " & IpAddress.Address.ToString & vbCrLf)
RichTextBox1.AppendText("Subnetmask : " & IpAddress.IPv4Mask.ToString & vbCrLf)
Next
For Each gatewayAddr As System.Net.NetworkInformation.GatewayIPAddressInformation In adapter.GetIPProperties.GatewayAddresses
' Get IP gateway information
RichTextBox1.AppendText("Gateway : " & gatewayAddr.Address.ToString & vbCrLf)
Next
' ?????????????????????????????????? Get DNS information ???????????????????????????????????
Next
2. In my RichTextBox are the in the information of all LAN-Adapters (4 pieces at this computer) with my code below. Thats ok. But is it possible to get the information of only one Adapter, which is called "LAN-Connection 3" and to show this informations (IP, Subnet, Gateway, DNS) in 4 Labels? Could you show me the code please, if it´s possible?
Continue reading...
I hope you can help me. I got 2 questions :
2. How can I show the DNS address in this code and the names like "LAN-Connection 3" ?
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
RichTextBox1.Clear()
For Each adapter In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim IpAddress As UnicastIPAddressInformation
For Each IpAddress In adapter.GetIPProperties.UnicastAddresses
' ?????????????????????????????????? Get names ???????????????????????????????????
' Get IP and Subnet information
RichTextBox1.AppendText("IP Addresse : " & IpAddress.Address.ToString & vbCrLf)
RichTextBox1.AppendText("Subnetmask : " & IpAddress.IPv4Mask.ToString & vbCrLf)
Next
For Each gatewayAddr As System.Net.NetworkInformation.GatewayIPAddressInformation In adapter.GetIPProperties.GatewayAddresses
' Get IP gateway information
RichTextBox1.AppendText("Gateway : " & gatewayAddr.Address.ToString & vbCrLf)
Next
' ?????????????????????????????????? Get DNS information ???????????????????????????????????
Next
2. In my RichTextBox are the in the information of all LAN-Adapters (4 pieces at this computer) with my code below. Thats ok. But is it possible to get the information of only one Adapter, which is called "LAN-Connection 3" and to show this informations (IP, Subnet, Gateway, DNS) in 4 Labels? Could you show me the code please, if it´s possible?
Continue reading...