//C#唤醒远程机器方法
public void WakeUpStart(string macInput)
{
try {
//被动开机物理地址xx-xx-xx-xx-xx-xx
string str = macInput;
byte[] mac = new byte[6];
string[] sArray = str.Split('-');
//mac地址从string转换成byte
for (var i = 0; i < 6; i++)
{
var byteValue = Convert.ToByte(sArray[i] , 16);
mac[i] = byteValue;
}
UdpClient client = new UdpClient();
client.Connect(IPAddress.Broadcast, 800);
byte[] packet = new byte[17 * 6];
for (int i = 0; i < 6; i++)
packet[i] = 0xFF;
for (int i = 1; i <= 16; i++)
for (int j = 0; j < 6; j++)
packet[i * 6 + j] = mac[j];
int result = client.Send(packet, packet.Length);
}
catch {; };
}