局域网多媒体中控控制 (音量、关机、心跳)
<i class="pstatus"> 本帖最后由 wtujoxk 于 2022-5-25 13:58 编辑 </i><br /><br />
软件使用UDP协议编写,针对多媒体中控控制电脑的音量,关机,心跳这三个功能进行编写!<br />
通讯协议在说明栏中,运行软件会在当前目录下生成一个config.txt文件,里面保存了设置!<br />
修改参数设置后,记得点一下保存!<br />
<br />
<ignore_js_op>
<div class="tip tip_4 aimg_tip" id="aimg_2524360_menu" style="position: absolute; display: none" disautofocus="true">
<div class="xs0">
<p><strong>1653374444(1).jpg</strong> <em class="xg1">(25.5 KB, 下载次数: 0)</em></p>
<p>
<a href="https://www.52pojie.org/forum.php?mod=attachment&aid=MjUyNDM2MHxlNTk0YmExY3wxNjUzOTQxMzk3fDB8MTY0MDM2NA%3D%3D¬humb=yes" target="_blank">下载附件</a>
</p>
<p class="xg1 y">2022-5-24 14:43 上传</p>
</div>
<div class="tip_horn"></div>
</div>
</ignore_js_op>
<br />
<ignore_js_op>
<div class="tip tip_4 aimg_tip" id="aimg_2524361_menu" style="position: absolute; display: none" disautofocus="true">
<div class="xs0">
<p><strong>1653374460(1).jpg</strong> <em class="xg1">(25.22 KB, 下载次数: 0)</em></p>
<p>
<a href="https://www.52pojie.org/forum.php?mod=attachment&aid=MjUyNDM2MXxkMDc3ZDBhY3wxNjUzOTQxMzk3fDB8MTY0MDM2NA%3D%3D¬humb=yes" target="_blank">下载附件</a>
</p>
<p class="xg1 y">2022-5-24 14:43 上传</p>
</div>
<div class="tip_horn"></div>
</div>
</ignore_js_op>
<br />
<br />
<ignore_js_op>
<div class="tip tip_4 aimg_tip" id="aimg_2524363_menu" style="position: absolute; display: none" disautofocus="true">
<div class="xs0">
<p><strong>1653374477(1).jpg</strong> <em class="xg1">(25.04 KB, 下载次数: 0)</em></p>
<p>
<a href="https://www.52pojie.org/forum.php?mod=attachment&aid=MjUyNDM2M3w3YmM0NTBiY3wxNjUzOTQxMzk3fDB8MTY0MDM2NA%3D%3D¬humb=yes" target="_blank">下载附件</a>
</p>
<p class="xg1 y">2022-5-24 14:43 上传</p>
</div>
<div class="tip_horn"></div>
</div>
</ignore_js_op>
<br />
<ignore_js_op>
<div class="tip tip_4 aimg_tip" id="aimg_2524362_menu" style="position: absolute; display: none" disautofocus="true">
<div class="xs0">
<p><strong>1653374496(1).png</strong> <em class="xg1">(28.74 KB, 下载次数: 0)</em></p>
<p>
<a href="https://www.52pojie.org/forum.php?mod=attachment&aid=MjUyNDM2Mnw4MGMxZjNjZXwxNjUzOTQxMzk3fDB8MTY0MDM2NA%3D%3D¬humb=yes" target="_blank">下载附件</a>
</p>
<p class="xg1 y">2022-5-24 14:43 上传</p>
</div>
<div class="tip_horn"></div>
</div>
</ignore_js_op>
<br />
<br />
<strong><font color="#ff0000">下载地址:</font></strong><font color="#336699"><strong><u>https://nns.lanzoub.com/iChp405dce2h</u></strong></font><br />
<br />
<font color="#336699"><strong><u>调试助手下载地址:<a rel="nofollow noopener" href="https://nns.lanzoub.com/iq1D305dcpgh" target="_blank">https://nns.lanzoub.com/iq1D305dcpgh</a></u></strong></font><br />
<font color="#336699"><strong>使用调试助手可以测试软件可用性!</strong></font><br />
<br />
<font color="#000000"><strong>20220525添加心跳测试小软件</strong></font><br />
<font color="#000000"><strong>用法见下图</strong></font><br />
<ignore_js_op>
<div class="tip tip_4 aimg_tip" id="aimg_2524641_menu" style="position: absolute; display: none" disautofocus="true">
<div class="xs0">
<p><strong>1653458110.jpg</strong> <em class="xg1">(190.2 KB, 下载次数: 0)</em></p>
<p>
<a href="https://www.52pojie.org/forum.php?mod=attachment&aid=MjUyNDY0MXw1M2U5ZTkzYXwxNjUzOTQxMzk3fDB8MTY0MDM2NA%3D%3D¬humb=yes" target="_blank">下载附件</a>
</p>
<p class="xg1 y">2022-5-25 13:55 上传</p>
</div>
<div class="tip_horn"></div>
</div>
</ignore_js_op>
<br />
<br />
<strong>心跳测试小软件下载:</strong><font color="#000000"><strong>https://nns.lanzoub.com/iEVjg05etele</strong></font><br />
<font color="#000000"><strong>源码:</strong></font><br />
<div style="padding:15px 0;"><div style="font-size:12px;"> <em class="viewsource" style="cursor:pointer;font-size:12px;color:#369 !important;">纯文本查看</em> <em class="copycode" style="cursor:pointer;font-size:12px;color:#369 !important;">复制代码</em></div><pre class="brush: csharp; gutter: true">using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Net;
namespace 心跳测试
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//在线电脑集合
Dictionary<string, DateTime> dicComputer = new Dictionary<string, DateTime>();
private void Form1_Load(object sender, EventArgs e)
{
new Thread(() =>
{
UdpClient uc = new UdpClient(new IPEndPoint(IPAddress.Any, 5467));
//设置UDP超时接收时间
uc.Client.ReceiveTimeout = 4000;
while (true)
{
try
{
IPEndPoint ipEndPoint = null;
byte[] bytes = uc.Receive(ref ipEndPoint);
this.Invoke((EventHandler)delegate { textBox1.Text = string.Empty; });
string computer = ipEndPoint.Address.ToString();
if (!dicComputer.ContainsKey(computer))
dicComputer.Add(computer, DateTime.Now);
else
dicComputer = DateTime.Now;
//心跳时间为2秒一次,筛选离线电脑
dicComputer = dicComputer.Where(x => (DateTime.Now - x.Value).Seconds < 4).ToDictionary(x => x.Key, x => x.Value);
foreach (var onlineComputer in dicComputer)
{
this.Invoke((EventHandler)delegate
{
textBox1.AppendText(onlineComputer + " 电脑在线" + Environment.NewLine);
});
}
}
catch (Exception ex)
{
//心跳时间为2秒一次,如果服务端4秒钟都未收到新消息,则认为所有电脑离线
this.Invoke((EventHandler)delegate { textBox1.Text = "没有电脑在线"; });
}
}
})
{ IsBackground = true }.Start();
}
}
}</pre></div> 不错,收藏备用 支持下。。。。。。。。。。 这个牛, 网管 专用 ,,,, 感谢楼主的分享 局域网内电脑,远程关机,如何操作? 关机控制端 怎么发命令 控制端?服务器端? 这是干嘛用的呢? 功能太少了建议加入播放停止运行程序发送udp指令等功能
页:
[1]