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

19 lines
487 B
C#

using NetworkResurrector.Server.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");
}
}
}