C# Class WinLib.Network.NetworkInterface

Describe your class quickly here.
Add more details here.
Show file Open project: SortByte/Network-Manager Class Usage Examples

Public Properties

Property Type Description
DefaultIPv4Gateway string
DefaultIPv4GatewayMac string
Description string
DhcpServer string
Dhcpv4Enabled Dhcp
Dhcpv6Server string
Guid System.Guid
IPv4Address List
IPv4BytesReceived System.Int64
IPv4BytesSent System.Int64
IPv4DnsServer List
IPv4Enabled bool
IPv4Gateway List
IPv4InSpeed double
IPv4InSpeedAvg10 double
IPv4InSpeedAvg20 double
IPv4InSpeedAvg40 double
IPv4Mtu string
IPv4OutSpeed double
IPv4OutSpeedAvg10 double
IPv4OutSpeedAvg20 double
IPv4OutSpeedAvg40 double
IPv6Address IPv6HostAddress
IPv6DnsServer List
IPv6Enabled bool
IPv6Gateway List
IPv6Mtu string
IPv6RouterDiscoveryEnabled bool
Index int
InterfaceMetric ushort
LocalIPv4Exit string
Loopback NetworkInterface
Mac string
Name string
NetbiosEnabled Netbios
PublicIPv4 string
PublicIPv6 string
Type AdapterType
networkInterface System.Net.NetworkInformation.NetworkInterface

Public Methods

Method Description
AddIPv4Address ( string ip, string mask ) : void
AddIPv4Address ( string name, string ip, string mask ) : void
AddIPv4DnsServer ( string dns ) : void
AddIPv4DnsServer ( string name, string dns ) : void
AddIPv4Gateway ( int index, string gateway, string metric ) : void

Vista and above only

AddIPv4Gateway ( string gateway, string metric ) : void
AddIPv4Gateway ( string mac, string gateway, string metric ) : void

XP only

AddIPv6Address ( int index, string ip, string prefix ) : void

Vista and above only

AddIPv6Address ( string ip, string prefix ) : void

Vista and above only

AddIPv6DnsServer ( int index, string dns ) : void

Vista and above only

AddIPv6DnsServer ( string dns ) : void

Vista and above only

AddIPv6Gateway ( int index, string gateway, string metric ) : void

Vista and above only

AddIPv6Gateway ( string gateway, string metric ) : void

Vista and above only

CheckDefaultIPv4Gateway ( ) : bool

Checks if the default gateway replies to an ARP request

CheckIfIPv4Used ( string ip, System.Guid excludedGuid = newGuid() ) : string
ClearGateways ( ) : void

IPv4 and IPv6

ClearGateways ( int index ) : void
ClearGateways ( string mac ) : void

IPv4 and IPv6 IT APPEARS THAT IS NOT WORKING

ClearIPv4Addresses ( string mac, string ip, string mask ) : void

Enables static TCP/IPv4 addressing for the target network adapter clearing any existing IPv4 address configurations. As a result, DHCP for this network adapter is disabled.

ClearIPv4DnsServers ( ) : void

IPv4 only

ClearIPv4DnsServers ( string mac ) : void

IPv4 only

DeleteIPv4Address ( string ip, string mask ) : void
DeleteIPv4Address ( string name, string ip, string mask ) : void
DeleteIPv4DnsServer ( string dns ) : void
DeleteIPv4DnsServer ( string name, string dns ) : void
DeleteIPv4Gateway ( int index, string gateway ) : void

Vista and above only

DeleteIPv4Gateway ( string gateway ) : void
DeleteIPv4Gateway ( string mac, string gateway ) : void

XP only

DeleteIPv6Address ( int index, string ip ) : void

Vista and above only

DeleteIPv6Address ( string ip ) : void

Vista and above only

DeleteIPv6DnsServer ( int index, string dns ) : void

Vista and above only

DeleteIPv6DnsServer ( string dns ) : void

Vista and above only

DeleteIPv6Gateway ( int index, string gateway ) : void

Vista and above only

DeleteIPv6Gateway ( string gateway ) : void

Vista and above only

EditIPv4Gateway ( int index, string gateway, string metric ) : void

Vista and above only

EditIPv4Gateway ( string gateway, string metric ) : void
EditIPv4Gateway ( string mac, string gateway, string metric ) : void

XP only

EditIPv6Gateway ( int index, string gateway, string metric ) : void

Vista and above only

EditIPv6Gateway ( string gateway, string metric ) : void

Vista and above only

GetAdapterStatus ( string friendlyName ) : Status
GetAll ( Action UpdateStatus = null ) : NetworkInterface>.ConcurrentDictionary
GetInterfaceMetric ( string ipAddress, string subnet ) : ushort

Win32_NetworkAdapterConfiguration XP OK Vista/7 without PPP

GetInterfaceMetric ( ) : void

Win32_NetworkAdapterConfiguration XP OK Vista/7 without PPP

GetInternetInterface ( ) : string
GetPublicIP ( ) : void
GetStatistics ( ) : void
Netsh ( ) : Process
SetDhcp ( int enabled ) : void
SetDhcp ( string name, int enabled ) : void
SetIPv4Address ( string ip, string mask ) : void
SetIPv4Address ( string name, string ip, string mask ) : void
SetIPv4DnsServer ( string dns ) : void
SetIPv4DnsServer ( string name, string dns ) : void
SetIPv4Mtu ( int index, string mtu ) : void

Vista and above only

SetIPv4Mtu ( string mtu ) : void

Vista and above only

SetIPv6Mtu ( int index, string mtu ) : void

Vista and above only

SetIPv6Mtu ( string mtu ) : void

Vista and above only

SetInterfaceMetric ( int index, string metric ) : void

Vista and above only

SetInterfaceMetric ( string metric ) : void
SetInterfaceMetric ( string mac, string metric ) : void

XP only

SetNetBios ( System.Guid guid, bool enabled ) : void
SetNetBios ( bool enabled ) : void
SetRouterDiscovery ( bool enabled ) : void

Vista and above only

SetRouterDiscovery ( int index, bool enabled ) : void

Vista and above only

Method Details

AddIPv4Address() public method

public AddIPv4Address ( string ip, string mask ) : void
ip string
mask string
return void

AddIPv4Address() public static method

public static AddIPv4Address ( string name, string ip, string mask ) : void
name string
ip string
mask string
return void

AddIPv4DnsServer() public method

public AddIPv4DnsServer ( string dns ) : void
dns string
return void

AddIPv4DnsServer() public static method

public static AddIPv4DnsServer ( string name, string dns ) : void
name string
dns string
return void

AddIPv4Gateway() public static method

Vista and above only
public static AddIPv4Gateway ( int index, string gateway, string metric ) : void
index int
gateway string
metric string
return void

AddIPv4Gateway() public method

public AddIPv4Gateway ( string gateway, string metric ) : void
gateway string
metric string
return void

AddIPv4Gateway() public static method

XP only
public static AddIPv4Gateway ( string mac, string gateway, string metric ) : void
mac string
gateway string
metric string
return void

AddIPv6Address() public static method

Vista and above only
public static AddIPv6Address ( int index, string ip, string prefix ) : void
index int
ip string
prefix string
return void

AddIPv6Address() public method

Vista and above only
public AddIPv6Address ( string ip, string prefix ) : void
ip string
prefix string
return void

AddIPv6DnsServer() public static method

Vista and above only
public static AddIPv6DnsServer ( int index, string dns ) : void
index int
dns string
return void

AddIPv6DnsServer() public method

Vista and above only
public AddIPv6DnsServer ( string dns ) : void
dns string
return void

AddIPv6Gateway() public static method

Vista and above only
public static AddIPv6Gateway ( int index, string gateway, string metric ) : void
index int
gateway string
metric string
return void

AddIPv6Gateway() public method

Vista and above only
public AddIPv6Gateway ( string gateway, string metric ) : void
gateway string
metric string
return void

CheckDefaultIPv4Gateway() public method

Checks if the default gateway replies to an ARP request
public CheckDefaultIPv4Gateway ( ) : bool
return bool

CheckIfIPv4Used() public static method

public static CheckIfIPv4Used ( string ip, System.Guid excludedGuid = newGuid() ) : string
ip string
excludedGuid System.Guid
return string

ClearGateways() public method

IPv4 and IPv6
public ClearGateways ( ) : void
return void

ClearGateways() public static method

public static ClearGateways ( int index ) : void
index int
return void

ClearGateways() public static method

IPv4 and IPv6 IT APPEARS THAT IS NOT WORKING
public static ClearGateways ( string mac ) : void
mac string
return void

ClearIPv4Addresses() public static method

Enables static TCP/IPv4 addressing for the target network adapter clearing any existing IPv4 address configurations. As a result, DHCP for this network adapter is disabled.
public static ClearIPv4Addresses ( string mac, string ip, string mask ) : void
mac string
ip string The IPv4 address that will replace an exisiting configurations
mask string The IPv4 mask that will replace an exisiting configurations
return void

ClearIPv4DnsServers() public method

IPv4 only
public ClearIPv4DnsServers ( ) : void
return void

ClearIPv4DnsServers() public static method

IPv4 only
public static ClearIPv4DnsServers ( string mac ) : void
mac string
return void

DeleteIPv4Address() public method

public DeleteIPv4Address ( string ip, string mask ) : void
ip string
mask string
return void

DeleteIPv4Address() public static method

public static DeleteIPv4Address ( string name, string ip, string mask ) : void
name string
ip string
mask string
return void

DeleteIPv4DnsServer() public method

public DeleteIPv4DnsServer ( string dns ) : void
dns string
return void

DeleteIPv4DnsServer() public static method

public static DeleteIPv4DnsServer ( string name, string dns ) : void
name string
dns string
return void

DeleteIPv4Gateway() public static method

Vista and above only
public static DeleteIPv4Gateway ( int index, string gateway ) : void
index int
gateway string
return void

DeleteIPv4Gateway() public method

public DeleteIPv4Gateway ( string gateway ) : void
gateway string
return void

DeleteIPv4Gateway() public static method

XP only
public static DeleteIPv4Gateway ( string mac, string gateway ) : void
mac string
gateway string
return void

DeleteIPv6Address() public static method

Vista and above only
public static DeleteIPv6Address ( int index, string ip ) : void
index int
ip string
return void

DeleteIPv6Address() public method

Vista and above only
public DeleteIPv6Address ( string ip ) : void
ip string
return void

DeleteIPv6DnsServer() public static method

Vista and above only
public static DeleteIPv6DnsServer ( int index, string dns ) : void
index int
dns string
return void

DeleteIPv6DnsServer() public method

Vista and above only
public DeleteIPv6DnsServer ( string dns ) : void
dns string
return void

DeleteIPv6Gateway() public static method

Vista and above only
public static DeleteIPv6Gateway ( int index, string gateway ) : void
index int
gateway string
return void

DeleteIPv6Gateway() public method

Vista and above only
public DeleteIPv6Gateway ( string gateway ) : void
gateway string
return void

EditIPv4Gateway() public static method

Vista and above only
public static EditIPv4Gateway ( int index, string gateway, string metric ) : void
index int
gateway string
metric string
return void

EditIPv4Gateway() public method

public EditIPv4Gateway ( string gateway, string metric ) : void
gateway string
metric string
return void

EditIPv4Gateway() public static method

XP only
public static EditIPv4Gateway ( string mac, string gateway, string metric ) : void
mac string
gateway string
metric string
return void

EditIPv6Gateway() public static method

Vista and above only
public static EditIPv6Gateway ( int index, string gateway, string metric ) : void
index int
gateway string
metric string
return void

EditIPv6Gateway() public method

Vista and above only
public EditIPv6Gateway ( string gateway, string metric ) : void
gateway string
metric string
return void

GetAdapterStatus() public static method

public static GetAdapterStatus ( string friendlyName ) : Status
friendlyName string
return Status

GetAll() public static method

public static GetAll ( Action UpdateStatus = null ) : NetworkInterface>.ConcurrentDictionary
UpdateStatus Action
return NetworkInterface>.ConcurrentDictionary

GetInterfaceMetric() public static method

Win32_NetworkAdapterConfiguration XP OK Vista/7 without PPP
public static GetInterfaceMetric ( string ipAddress, string subnet ) : ushort
ipAddress string IPv4 or IPv6
subnet string Dot-decimal-notation for IPv4 (i.e. "255.255.255.0") and CIDR for IPv6 (i.e. "64")
return ushort

GetInterfaceMetric() public method

Win32_NetworkAdapterConfiguration XP OK Vista/7 without PPP
public GetInterfaceMetric ( ) : void
return void

GetInternetInterface() public static method

public static GetInternetInterface ( ) : string
return string

GetPublicIP() public method

public GetPublicIP ( ) : void
return void

GetStatistics() public method

public GetStatistics ( ) : void
return void

Netsh() public static method

public static Netsh ( ) : Process
return System.Diagnostics.Process

SetDhcp() public method

public SetDhcp ( int enabled ) : void
enabled int
return void

SetDhcp() public static method

public static SetDhcp ( string name, int enabled ) : void
name string
enabled int
return void

SetIPv4Address() public method

public SetIPv4Address ( string ip, string mask ) : void
ip string
mask string
return void

SetIPv4Address() public static method

public static SetIPv4Address ( string name, string ip, string mask ) : void
name string
ip string
mask string
return void

SetIPv4DnsServer() public method

public SetIPv4DnsServer ( string dns ) : void
dns string
return void

SetIPv4DnsServer() public static method

public static SetIPv4DnsServer ( string name, string dns ) : void
name string
dns string
return void

SetIPv4Mtu() public static method

Vista and above only
public static SetIPv4Mtu ( int index, string mtu ) : void
index int
mtu string
return void

SetIPv4Mtu() public method

Vista and above only
public SetIPv4Mtu ( string mtu ) : void
mtu string
return void

SetIPv6Mtu() public static method

Vista and above only
public static SetIPv6Mtu ( int index, string mtu ) : void
index int
mtu string
return void

SetIPv6Mtu() public method

Vista and above only
public SetIPv6Mtu ( string mtu ) : void
mtu string
return void

SetInterfaceMetric() public static method

Vista and above only
public static SetInterfaceMetric ( int index, string metric ) : void
index int
metric string
return void

SetInterfaceMetric() public method

public SetInterfaceMetric ( string metric ) : void
metric string
return void

SetInterfaceMetric() public static method

XP only
public static SetInterfaceMetric ( string mac, string metric ) : void
mac string
metric string
return void

SetNetBios() public static method

public static SetNetBios ( System.Guid guid, bool enabled ) : void
guid System.Guid
enabled bool
return void

SetNetBios() public method

public SetNetBios ( bool enabled ) : void
enabled bool
return void

SetRouterDiscovery() public method

Vista and above only
public SetRouterDiscovery ( bool enabled ) : void
enabled bool
return void

SetRouterDiscovery() public static method

Vista and above only
public static SetRouterDiscovery ( int index, bool enabled ) : void
index int
enabled bool
return void

Property Details

DefaultIPv4Gateway public property

The default gateway with the smallest metric that is reachable
public string DefaultIPv4Gateway
return string

DefaultIPv4GatewayMac public property

public string DefaultIPv4GatewayMac
return string

Description public property

public string Description
return string

DhcpServer public property

public string DhcpServer
return string

Dhcpv4Enabled public property

public Dhcp Dhcpv4Enabled
return Dhcp

Dhcpv6Server public property

public string Dhcpv6Server
return string

Guid public property

public Guid,System Guid
return System.Guid

IPv4Address public property

public List IPv4Address
return List

IPv4BytesReceived public property

public Int64,System IPv4BytesReceived
return System.Int64

IPv4BytesSent public property

public Int64,System IPv4BytesSent
return System.Int64

IPv4DnsServer public property

public List IPv4DnsServer
return List

IPv4Enabled public property

public bool IPv4Enabled
return bool

IPv4Gateway public property

public List IPv4Gateway
return List

IPv4InSpeed public property

public double IPv4InSpeed
return double

IPv4InSpeedAvg10 public property

public double IPv4InSpeedAvg10
return double

IPv4InSpeedAvg20 public property

public double IPv4InSpeedAvg20
return double

IPv4InSpeedAvg40 public property

public double IPv4InSpeedAvg40
return double

IPv4Mtu public property

public string IPv4Mtu
return string

IPv4OutSpeed public property

public double IPv4OutSpeed
return double

IPv4OutSpeedAvg10 public property

public double IPv4OutSpeedAvg10
return double

IPv4OutSpeedAvg20 public property

public double IPv4OutSpeedAvg20
return double

IPv4OutSpeedAvg40 public property

public double IPv4OutSpeedAvg40
return double

IPv6Address public property

public IPv6HostAddress IPv6Address
return IPv6HostAddress

IPv6DnsServer public property

public List IPv6DnsServer
return List

IPv6Enabled public property

public bool IPv6Enabled
return bool

IPv6Gateway public property

public List IPv6Gateway
return List

IPv6Mtu public property

public string IPv6Mtu
return string

IPv6RouterDiscoveryEnabled public property

Indicates whether or not Router Advertisments are processed Regardless, DHCPv6 is always used if there is an DHCPv6 server on the network
public bool IPv6RouterDiscoveryEnabled
return bool

Index public property

public int Index
return int

InterfaceMetric public property

public ushort InterfaceMetric
return ushort

LocalIPv4Exit public property

Local address in the same network as the default gateway with the smallest metric
public string LocalIPv4Exit
return string

Loopback public static property

public static NetworkInterface Loopback
return NetworkInterface

Mac public property

public string Mac
return string

Name public property

public string Name
return string

NetbiosEnabled public property

public Netbios NetbiosEnabled
return Netbios

PublicIPv4 public property

public string PublicIPv4
return string

PublicIPv6 public property

public string PublicIPv6
return string

Type public property

public AdapterType Type
return AdapterType

networkInterface public property

public NetworkInterface,System.Net.NetworkInformation networkInterface
return System.Net.NetworkInformation.NetworkInterface