Wake on Lan
Table of Contents
WoL 先决条件
需要PC 需要建立以太网连接。
最适用于始终插入以太网的台式机或笔记本电脑。
需要在计算机的 BIOS 中启用 WoL
需要在windows10中设置以太网控制器
在windows10设备驱动管理器中,找到 网络适配器 ,在第一个驱动 右键 -> 属性
设置好 PC 后,设备准备好唤醒设备。
Magic Packet - Wake-on-LAN-enabled computers essentially wait for a "magic packet"
Wake-on-LAN-enabled computers essentially wait for a "magic packet" to arrive that includes the network card's MAC address in it. These magic packets are sent out by professional software made for any platform, but can also be sent by routers and internet-based websites. The typical ports used for WoL magic packets are UDP 7 and 9. Because your computer is actively listening for a packet, some power is feeding your network card which will result in your laptop's battery draining faster, so road warriors should take care to turn this off when you need to eke out some extra juice.
Magic Packet Format
A physical WakeOnLAN (Magic Packet) will look like this:
Synchronization Stream Target MAC Password (optional)
6 96 0, 4 or 6
Magic packet
Here is a screenshot of some WakeOnLAN traffic:
Send Magic Packet in c#
implementation of WoL in C# below
c++
Wake On Lan over the Internet
Wake on Lan Magic Packets can be sent over the Internet
https://www.depicus.com/wake-on-lan/woli
useful links
sending Wake-on-LAN magic packets in C#
https://github.com/BornToBeRoot/NETworkManager