Void TForm1: : WakeUpRemote (AnsiString IPAddress, unsigned char * MacAddress)
{
Unsigned char SendBuf [102].
For (int I=0; I & lt; 102; I + +)
{
SendBuf [I]=(I & lt; 6)? 0 XFF: MacAddress [6] I %;
}
TMemoryStream * MemoryStream=new TMemoryStream ();
MemoryStream - & gt; The Clear ();
MemoryStream - & gt; Write (SendBuf, 102);
NMUDP1 - & gt; RemoteHost=IPAddress;
NMUDP1 - & gt; SendStream (MemoryStream);
Delete the MemoryStream;
ShowMessage (" has been sent." );
}
Void __fastcall TForm1: : Button1Click (TObject * Sender)
{
WakeUpRemote (AnsiString (" 192.168.226.100 "), (unsigned char *) AnsiString (" 009030032 ff3 "). The c_str ());
}
I copied the code on the net, wrote Button1Click, found no, is this parameter is there a problem?
(unsigned char *) AnsiString (" 009030032 ff3 "). The c_str ()
That how to write is correct? Warrior solutions,
CodePudding user response:
Unknown sleep and completeCodePudding user response:
//(unsigned char *) AnsiString (" 009030032 ff3 "). The c_str ()To the following test under
Unsigned char my_mac []={x90 0 x00 to 0, 0 x30, 0 x03, x2f, 0 0 xf3};
CodePudding user response:
Remote sensei technology (WOL, Wake - on - LAN) is a network card with other software and hardware, can through the technique of LAN to realize remote boot, no matter be accessed computer how far is it from us, in what position, as long as in the same local area network (LAN), it can be launched at any time, this technique is very suitable for remote network management requirements of the environment, if there is such a request card when the choose and buy should pay attention to whether have this function,
Can be awakened by the remote computer for hardware has certain requirements, main performance in the network card, main board and power supply,
1. The card can realize remote sensei, one of the main components are network card, in favor of WOL distal awakened the computer's network card must support the WOL, and used to wake up the other computer network card is not necessary to support the WOL, on the other hand, when a computer when equipped with multiple network card, only set one of the blocks to remote sensei,
2. Motherboard motherboard must also support remote sensei, but by looking at whether the CMOS "Power Management Setup" menu with "Wake on LAN" item and confirm, in addition, support remote sensei motherboard usually have a dedicated 3 core outlet, Power supply (PCI2.1 standards) to the network Card, because now the motherboard typically support PCI 2.2 standard, can be directly to the network Card through PCI slot provides Standby Power supply + 3.3 V, even if you don't also can realize remote sensei WOL supply cord, therefore, may no longer provide 3 core outlet, the main support PCI2.2 standards, but by looking at the CMOS "Power Management Setup menu" have "Wake on PCI Card" to confirm,
3. If the power supply to realize remote sensei, computer installation must be in conformity with the ATX standard 2.01 ATX power supply, + 5 v Standby current should be at least more than 600 ma,
Computer has remote sensei function is not equal to realize remote sensei, before implementation, must also be to make the necessary hardware connection and Settings, and with the help of the corresponding software is needed to achieve, for example, using AMD the Magic Packet to as remote sensei software, etc.,
CodePudding user response:
First take a look at your network adapter and network adapter configuration, and then use AMD the Magic Packet remote wake-up test software, reoccupy after normal test program