Posted in 面试题 onDecember 07, 2015
代码如下:
WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal currentPrincipal = new WindowsPrincipal(currentIdentity);
if (currentPrincipal.IsInRole(@”HZ\Domain Users”))
{
this.button1.Text = “YEAH!”;
}
WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal currentPrincipal = new WindowsPrincipal(currentIdentity);
if (currentPrincipal.IsInRole(@”HZ\Domain Users”))
{
this.button1.Text = “YEAH!”;
}
C#如何判断当前用户是否输入某个域
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Tags in this post...
Reply on: @reply_date@
@reply_contents@