Click here to Skip to main content
12,760,662 members (33,737 online)
Click here to Skip to main content


81 bookmarked
Posted 27 Oct 2003

Wake-On-Lan Class

, 27 Oct 2003
Class to wake up a remote machine by sending a Wake-On-Lan packet.
using System;
/* (c)2003 M.Kruppa */
namespace NetTools
	/// <summary>
	/// Summary description for WakeUp class
	/// This is the comand line application class for Wake-Up-On-Lan using MagicPacket Class.
	/// </summary>
	class WakeUp
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		static void Main(string[] args)
			string macAdress; 
			int byteSend;
				+"Copyright(C)2003 by M. Kruppa <>\n");
			//reading comand line arguments
			if ((args.Length != 0) && ((args[0].Length == 12) || (args[0].Length == 17)))
				macAdress = args[0];
				//create MagicPacket(TM)
				MagicPacket wakeUpPacket = new NetTools.MagicPacket(macAdress);
				//wake up machine
				byteSend = wakeUpPacket.WakeUp();
				Console.WriteLine("{0} Byte Send to {1}", byteSend, wakeUpPacket.macAddress);
				Console.WriteLine("Usage: WakeUp <MAC>\n"
					+"Example: WakeUp A1:B2:C3:D4:E5:F6");

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Team Leader
Germany Germany
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 28 Oct 2003
Article Copyright 2003 by mkruppa
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid