I'm building a server-appllication and i need to be able to select the correct networkinterface to start the listening events.
using the following code i put a list off all available interfaces in a menu.
After i selected a adapter i want to know wich ip-adres is bound to it.
so what code, do i need to put there?
i've been searching here, but i couldn't find the answer.
using the following code i put a list off all available interfaces in a menu.
VB.NET:
Imports System.Net.NetworkInformation
VB.NET:
Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim adapter As NetworkInterface
For Each adapter In adapters
Dim status As OperationalStatus
status = adapter.OperationalStatus
If status = NetworkInformation.OperationalStatus.Up Then
AdapterToolStripMenuItem.DropDownItems.Add(adapter.Description)
AdapterToolStripMenuItem.CheckOnClick = True
End If
Next adapter
After i selected a adapter i want to know wich ip-adres is bound to it.
VB.NET:
Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
With adapterProperties
'?????
End With
so what code, do i need to put there?
i've been searching here, but i couldn't find the answer.
Last edited: