Logger.StackTrace

This commit is contained in:
龙腾猫跃 committed 2026-07-01 06:58:01 +08:00
1 parent d3daf1988f
commit c18fef7074
3 files changed
+9 -2

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
using System.Security.Principal;
namespace MeloongCore;
public static class WindowsUtils {
/// <summary>
/// 当前程序是否拥有管理员权限。
/// </summary>
public static bool HasAdminRole() {
using var id = WindowsIdentity.GetCurrent();
return new WindowsPrincipal(id).IsInRole(WindowsBuiltInRole.Administrator);
}
}