アクティブなディレクトリからユーザの名前が必要です。 social.msdn.microsoft.comから
string name ="";
using (var context = new PrincipalContext(ContextType.Domain))
{
var usr = UserPrincipal.FindByIdentity(context, User.Identity.Name);
if (usr != null)
name = usr.DisplayName;
}
又はこれ:
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
UserPrincipal user = UserPrincipal.Current;
string displayName = user.DisplayName;
かであり得る:
System.DirectoryServices.AccountManagement.UserPrincipal.Current.DisplayName;
System.DirectoryServices.AccountManagement namespaceユーザの均一なアクセスおよび操作、コンピューターを提供し、このようなコードを試します複数のプリンシパルストア間でセキュリティプリンシパルをグループ化する:Active Directoryドメインサービス(AD DS)、Active Directory (AD LDS)、およびマシンSAM(MSAM)をサポートしています。
私は完全な表示名 – MethodMan