BizTalk Utilities CV ,   Jobs ,   Code library
Go to the front page to continue learning about XML or select below:


ReBlogger Contents

Previous posts in WSCF/WCF

Page 6352 of 21350

Wake-on-LAN from a .NET Micro Framework Device

Blogger : Schwarz .NET Framework Snippets and Samples
All posts : All posts by Schwarz .NET Framework Snippets and Samples
Category : WSCF/WCF
Blogged date : 2008 Mar 09

Well, I love the easy development of embedded devices with the .NET Micro Framework. As the device I'm currently using is really small I tried to build a small Web site on it to start my private servers at home using Wake-on-LAN. You'll find a lot of helper methods samples on the Internet but I couldn't find on source code that was working on the .NET Micro Framework. The problem is that there are too many missing methods or enum values.

Here is the source code I'm using now which is working.

public static void WakeUp(byte[] mac) { using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) { IPEndPoint endPoint = new IPEndPoint(new IPAddress(4294967295), 40000); // IP socket.Connect(endPoint); 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]; socket.Send(packet); } }

Using my Web server (which I will publish this week at including the Ajax.NET M! library it is really cool to connect to the .NET Micro Framework enabled device from outside and start your servers as you need.

Read comments or post a reply to : Wake-on-LAN from a .NET Micro Framework Device
Page 6352 of 21350

Newest posts

    Email TopXML