星空网 > 软件开发 > ASP.net

C# 当前系统的多管理账户测判断

  using (DirectoryEntry comp = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"))        {          int AccountCount = 0;          foreach (DirectoryEntry child in comp.Children)          {            //获取账户名称            if (child.SchemaClassName == "User")            {              using (DirectoryEntry NewUser = comp.Children.Find(child.Name, "user"))              {                //判断该账户是否被禁用                bool AccountState = Convert.ToBoolean(NewUser.InvokeGet("AccountDisabled"));                if (!AccountState)                {                  AccountCount += 1;                }                //var state = NewUser.Properties["UserFlags"].Value.ToString();                //if (state == "66049" || state == "66145")                //{                //  AccountCount += 1;                //}              }            }          }          if (AccountCount > 1)          {            return 0;          }          else          {            return 1;          }        }

  




原标题:C# 当前系统的多管理账户测判断

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

虾皮和lazada对比:https://www.goluckyvip.com/tag/84740.html
lazada菲律宾卖家:https://www.goluckyvip.com/tag/84742.html
菲律宾lazada卖家:https://www.goluckyvip.com/tag/84743.html
lazada防关联:https://www.goluckyvip.com/tag/84744.html
商家入驻lazada:https://www.goluckyvip.com/tag/84745.html
lazada商家入驻:https://www.goluckyvip.com/tag/84746.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流