Hey,
It would be nice if a MAC address field could be added to the server properties dialog, and then a button to wake it using Wake on LAN.
Here is a code snippet that I have been using to wake clients over the network, feel free to use it as you like (and everyone else for that matter):
-----------------------------------
String[] sections;
byte[] mac = new byte[6];
try
{
sections = txtMacAddress.Text.Split(":".ToCharArray());
if (sections.Length != 6)
throw new Exception();
for (int i = 0; i < mac.Length; i++)
mac[i] = byte.Parse(sections[i], System.Globalization.NumberStyles.HexNumber);
}
catch (Exception)
{
MessageBox.Show(this, "Cannot parse input", "Error paring", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
UdpClient client = new UdpClient();
client.Connect(IPAddress.Broadcast, 40000);
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];
client.Send(packet, packet.Length);