我正在用C#编写一个应用程序,我需要能够确定用户是登录到Active Directory帐户还是登录到本地帐户。你知道怎么确定这个吗?
发布于 2014-05-10 10:50:06
你所能做的就是调用:
System.Security.Principal.WindowsIdentity i = System.Security.Principal.WindowsIdentity.GetCurrent();一旦获得了WindowsIdentity,就可以读取Name属性来获得域名。然后您可以将域名与预期的域名进行核对。
https://stackoverflow.com/questions/23576485
复制相似问题