Exemple #1
0
        public static void Send(WakeOnLANInfo info)
        {
            using (var udpClient = new UdpClient())
            {
                udpClient.Connect(info.Broadcast, info.Port);

                udpClient.Send(info.MagicPacket, info.MagicPacket.Length);
            }
        }
        public static WakeOnLANInfo CreateWakeOnLANInfo(ProfileInfo profileInfo)
        {
            var info = new WakeOnLANInfo
            {
                MagicPacket = CreateMagicPacket(profileInfo.WakeOnLAN_MACAddress),
                Broadcast   = IPAddress.Parse(profileInfo.WakeOnLAN_Broadcast),
                Port        = profileInfo.WakeOnLAN_OverridePort ? profileInfo.WakeOnLAN_Port : SettingsManager.Current.WakeOnLAN_Port
            };

            return(info);
        }