network-resurrector/NetworkResurrector.WakeOnLa.../WakeOnLanService.cs

19 lines
480 B
C#
Raw Normal View History

using NetworkResurrector.Abstractions;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading.Tasks;
namespace NetworkResurrector.WakeOnLan.Nikeee
{
public class WakeOnLanService : IWakeOnLanService
{
public async Task<(bool success, string message)> Wake(string macAddress)
{
var mac = PhysicalAddress.Parse(macAddress);
await mac.SendWolAsync();
return (true, "Success");
}
}
}