代码之家  ›  专栏  ›  技术社区  ›  Chris Smith

从域\别名组合中获取显示名称

  •  2
  • Chris Smith  · 技术社区  · 16 年前

    2 回复  |  直到 16 年前
        1
  •  6
  •   Abhijeet Patel    16 年前

    如果您使用的是.net 3.5,请添加对System的引用。目录服务和系统。目录服务。AccountManagement并尝试以下操作:

            PrincipalContext c = new PrincipalContext(ContextType.Domain,"CONTOSO");
            UserPrincipal principal = UserPrincipal.FindByIdentity(c,"steveh");
            Console.WriteLine(principal.DisplayName);
    

        2
  •  0
  •   Community Mohan Dere    8 年前