winform 里给一个按钮添加一个UAC 用户身份验证的。有谁做过没?前提在win7下面操作..
求解啊@大侠们......
internal bool IsRunAsAdmin() { WindowsIdentity id = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(id); return principal.IsInRole(WindowsBuiltInRole.Administrator); }