參考頁面:
http://www.yuanjiaocheng.net/webapi/create-web-api-proj.html
http://www.yuanjiaocheng.net/webapi/test-webapi.html
http://www.yuanjiaocheng.net/webapi/web-api-controller.html
http://www.yuanjiaocheng.net/webapi/config-webapi.html
http://www.yuanjiaocheng.net/webapi/web-api-route.html
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; WindowsIdentity identity = (WindowsIdentity)principal.Identity; FastPrincipal prin = new FastPrincipal(identity); isAdmin = prin.IsInRole(WindowsBuiltInRole.Administrator);