C# Class MonoDroidToolkit.NetworkUtils

显示文件 Open project: jamesmontemagno/MonoDroidToolkit

Public Methods

Method Description
GetAllNetworkInterfaces ( ) : List
GetHostName ( ) : string

Get system's hostname Can NOT be called from UI thread

GetIPAddress ( bool useIPv4 = true ) : String

Get IP address from first non-localhost interface

GetMacAddress ( string interfaceName = null ) : string

Returns MAC address of the given interface name.

Method Details

GetAllNetworkInterfaces() public static method

public static GetAllNetworkInterfaces ( ) : List
return List

GetHostName() public static method

Get system's hostname Can NOT be called from UI thread
public static GetHostName ( ) : string
return string

GetIPAddress() public static method

Get IP address from first non-localhost interface
public static GetIPAddress ( bool useIPv4 = true ) : String
useIPv4 bool true=return ipv4, false=return ipv6
return String

GetMacAddress() public static method

Returns MAC address of the given interface name.
public static GetMacAddress ( string interfaceName = null ) : string
interfaceName string interfaceName eth0, wlan0 or NULL=use first interface
return string