Enable the computer

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.