赞
踩
该篇文章是我于2009年6月10日通过自己编写的工具,批量从位于在博客园的博客站点(http://chenxizhang.cnblogs.com)同步而来。文章中的图片地址仍然是链接到博客园的。特此说明! 陈希章原文地址:http://www.cnblogs.com/chenxizhang/archive/2009/01/06/1370029.html原文标题:Windows应用程序中使用Windows验证方式要注意的地方 原文发表:2009/1/6 2:03:00 |
要取得当前用户的信息,必须先执行下面这句代码
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
然后,才可以通过
WindowsIdentity identity = WindowsIdentity.GetCurrent();
取得当前用户的凭据信息
也可以通过
System.Threading.Thread.CurrentPrincipal
作者:陈希章 出处:http://blog.csdn.net/chen_xizhang 本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。