feat: 添加arp支持,仅支持管理员模式

This commit is contained in:
2025-07-18 12:28:17 +08:00
parent 69c7cbf4d8
commit 12cd35edff
6 changed files with 109 additions and 47 deletions

View File

@@ -3,6 +3,8 @@
/// </summary>
public static class MsgBus
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
private static readonly UDPServer udpServer = new UDPServer(1234, 12);
/// <summary>
/// 获取UDP服务器
@@ -19,8 +21,13 @@ public static class MsgBus
/// 通信总线初始化
/// </summary>
/// <returns>无</returns>
public static void Init()
public async static void Init()
{
if (!Arp.IsAdministrator())
{
logger.Error($"非管理员运行ARP无法更新请用管理员权限运行");
// throw new Exception($"非管理员运行ARP无法更新请用管理员权限运行");
}
udpServer.Start();
isRunning = true;
}