feat: 添加arp支持,仅支持管理员模式
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user