When you enter the BIOS, you will find Nic wake-up, PCI modem wake-up, serial Ring wake-up, and clock wake-up. Generally, you need to wake up the clock when starting the instance at a scheduled time. However, if you want to enable your computer in other places, wake up the NIC to solve this problem.
Only two parameters are required for Nic wake-up: broadcast address and MAC address. For Intranet Nic wake-up, only the MAC address is required. The broadcast address is 255.255.255.255. But how can we know the broadcast address of the Internet ip address? The broadcast address is equal to the bitwise inversion of the subnet and the or operation of the ip address.
[] Ip = [] sub = (I =; I <ip. Length; I ++ = ()((~ Sub [I]) | ip [I]); View Code
Now, you only need to know what to send to the computer that needs to be woken up. The MAC magic package can wake up the NIC.
[] StrToHexByte (= hexStr. Replace (,). Replace (,). Replace (, (hexStr. Length % )! = + = [] ReturnBytes = [hexStr. length/(I =; I <returnBytes. length; I ++ = Convert. toByte (hexStr. substring (I *,), [] GetMagicPacket ([] returnBytes = [commandStr = (I =; I <; I ++ = Convert. toByte (commandStr. substring (I *,), [] macBytes = (I =; I <; I ++ = macBytes [I % View Code
In addition, the IP-to-MAC method is attached, but the MAC address can be obtained only when the computer is enabled.
This Nic wakeup is a Winform interface program, a console program, the console program is awakened by a bat file in batch by the computer
D: \ NetworkCardWake.exe 00-E0-4C-68-08-E7 183.233.129.53 183.233.129.1View Code
This program has reference to other people's blog, the complete program