Moli0
2021-12-15 24d68e7998e80cbd4ef3ed04acbf2539a9c5a46b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace WOLAwaken.Helper
{
    public class SendWOLPack
    {
        public byte[] SendData = new byte[102];
        public int[] macAddress = new int[] { 0x04, 0x92, 0x26, 0xBE, 0x92, 0x98 };
 
        public SendWOLPack()
        {
            int index = 0;
            for (int i = 0; i < 6; i++)
            {
                SendData[index++] = Convert.ToByte(0xFF);
            }
 
            for (int i = 0; i < 16; i++)
            {
                foreach (var a in macAddress)
                {
                    SendData[index++] = Convert.ToByte(a);
                }
            }
 
            new SendUdpPack().SendMessage(SendData);
        }
    }
}