문제

It is easy enough to determine if the user running my C# .NET 4.0 console app is a member of the local Administrators group. I am also trying to determine if it is running under LocalSystem. What is the best way to do that?

도움이 되었습니까?

해결책

WindowsIdentity.GetCurrent().User.IsWellKnown(WellKnownSidType.LocalSystemSid)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top