NetworkWakeHelper
public static class NetworkWakeHelper
1. Methods
1.1. EnableWOL(ISystemHost, string)
Enables Wake-on-LAN on a network interface.
public static void EnableWOL(ISystemHost host, string interfaceName)
| Name | Type | Description |
|---|---|---|
host |
ISystemHost |
|
interfaceName |
string |
Name of the network interface (e.g., "Ethernet", "eth0") |
1.2. IsWOLEnabled(ISystemHost, string)
Checks if Wake-on-LAN is enabled on a network interface.
public static bool IsWOLEnabled(ISystemHost host, string interfaceName)
| Name | Type | Description |
|---|---|---|
host |
ISystemHost |
|
interfaceName |
string |
Name of the network interface (e.g., "Ethernet", "eth0") |
Returns: bool — True if WOL is enabled, false otherwise
1.3. SendMagicPacket(MAC, IP?, int, ILogger?)
Sends a Wake-on-LAN magic packet to a target MAC address.
public static void SendMagicPacket(MAC macAddress, IP? broadcastAddress = null, int port = 9, ILogger? logger = null)
| Name | Type | Description |
|---|---|---|
macAddress |
MAC |
Target MAC address (format: XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX) |
broadcastAddress |
IP? |
Broadcast address (default: 255.255.255.255) |
port |
int |
UDP port (default: 9) |
logger |
ILogger? |
Optional logger for diagnostic output |
1.4. WakeMachines(IEnumerable<MAC>, IP?, int, ILogger?)
Sends Wake-on-LAN magic packets to multiple MAC addresses.
public static void WakeMachines(IEnumerable<MAC> macAddresses, IP? broadcastAddress = null, int port = 9, ILogger? logger = null)
| Name | Type | Description |
|---|---|---|
macAddresses |
IEnumerable<MAC> |
Collection of MAC addresses |
broadcastAddress |
IP? |
Broadcast address (default: 255.255.255.255) |
port |
int |
UDP port (default: 9) |
logger |
ILogger? |
Optional logger for diagnostic output |