Platforms to show: All Mac Windows Linux Cross-Platform

Back to NetworkInterfaceMBS class.

NetworkInterfaceMBS.AllInterfaces(Merge as boolean = true) as NetworkInterfaceMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Network MBS Network Plugin 13.0 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Returns array with all interfaces.
Example
// show IPv4 addresses
dim interfaces() as NetworkInterfaceMBS = NetworkInterfaceMBS.AllInterfaces

for each n as NetworkInterfaceMBS in interfaces
MsgBox n.name+": "+n.IPv4
next

By default we merge several records for the same interface.
You may see one record for each protocol (IPv4, IPv6, LINK layer).

Some examples using this method:

NetworkInterfaceMBS.IndexMap as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Network MBS Network Plugin 14.2 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Builds a dictionary to map indexes to names.
Example
dim d as Dictionary = NetworkInterfaceMBS.IndexMap
dim lines() as string

for each key as Variant in d.keys
lines.Append key+": "+d.Value(key)
next

MsgBox Join(lines,EndOfLine)

This is convenient method for the case you need to show list to user.
On Windows requires Windows Vista or newer.

NetworkInterfaceMBS.IndexToName(Index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Network MBS Network Plugin 14.2 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Queries name for network interface with index.
Example
dim Name as string
Name = NetworkInterfaceMBS.IndexToName(1)
msgbox Name

On Windows requires Windows Vista or newer.

NetworkInterfaceMBS.NameToIndex(Name as String) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Network MBS Network Plugin 14.2 ✅ Yes ❌ No ✅ Yes ✅ Yes All
Queries index for network interface with given name..
Example
dim index as Integer
index = NetworkInterfaceMBS.NameToIndex("en0")

On Windows requires Windows Vista or newer.

The items on this page are in the following plugins: MBS Network Plugin.


The biggest plugin in space...