AR Magic Packet Library 1.0

You can use this library to send a magic packet to turn computers on remotely.

This library has two dependencies that you should take into account: the Microsoft Winsock Control (MSWINSCK.OCX) and the AR Registry Library.

History:

  • 24.06.2001, version 1.0 released.

Methods:

  • GetMACAddress (sIPAddress as String): returns a byte array containing the MAC address of the computer with the IP specified. Note: the computer has to be on.
  • GetMACAddressStr (sIPAddress as String): same as the previous method but returns the MAC address in a string.
  • SaveMACAddress (sComputerName as String, sIPAddress as String): takes the MAC address of the computer with the specified IP address and saves it in the local registry. Then you'll be able to turn this computer on by just using the assigned name with the SendMagicPacket2Computer method.
  • SendMagicPacket (arrMACAddress() as Byte, sDestination as String): sends a magic packet to network using the specified MAC address. Note 1: this is the only method that works under Windows 9x, Millenium, NT and 2.000. Note 2: sDestination is not the IP of the computer to turn on, but a broadcast address of the network. It would be something like 192.168.0.255.
  • SendMagicPacket2Computer (sComputerName as String): sends a magic packet to the computer specified in sComputerName. Previously you must have saved the MAC address of this computer into the local registry using the SaveMACAddress method.

Note: Except for the SendMagicPacket method, all the other methods only work under Windows 2.000. The computer you want to turn on can be using any other operating system.

If you are not using Windows 2.000 you can find out the MAC address of the network adapter of a computer by running this command from a DOS prompt:

    nbtstat -a ip_address

Of course, the network adapter of the computer that you want to turn on has to support the wake-on-lan specification. Also it usually needs to be plugged to the motherboard using an additional cable. Please, refer to the instructions of the network adapter and the motherboard for this.

You can read more about Magic Packet technology at the following address: http://www.amd.com/products/npd/overview/20212.html.

(11 Kb)