您当前的位置: 首页 >  网络

unity工具人

暂无认证

  • 3浏览

    0关注

    205博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

c#网络唤醒局域网内计算机(用mac地址)

unity工具人 发布时间:2020-08-26 10:35:03 ,浏览量:3

方法一:

 public void WakeUp(string macString)
    {
        try
        {
            if (macString.Split('-').Length == 6)
            {
                string macStr = macString.Replace('-', ' '); ;

                byte[] macByteArray = HexStringSToByteArray(macStr);

                UdpClient client = new UdpClient();
                client.Connect(IPAddress.Broadcast, 1234);//IPAddress.Broadcast:默认广播地址"255.255.255.255"
                //client.Connect("127.0.0.1", 1234);

                //print(IPAddress.Broadcast);

                byte[] packet = new byte[17 * 6];
                for (int i = 0; i             
关注
打赏
1656671177
查看更多评论
0.0407s