Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
40 Points
260 Posts
May 09, 2012 07:24 AM|LINK
Hi All,
I want to get the user name from the active directory.
I am using following code:
System.Security.Principal.WindowsIdentity wi = System.Security.Principal.WindowsIdentity.GetCurrent(); string[] a = Context.User.Identity.Name.Split('\\'); System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://" + a[0] + "/" + a[1]); string Name = ADEntry.Properties["FullName"].Value.ToString();
Here I am getting at error on highted line - 'user' is not reckon in the context class. "
Error 6 'System.Runtime.Remoting.Contexts.Context' does not contain a definition for 'User' "Context does not cotain defination of user"
Please suggest some way-out for this problem.
dotnet_CH
Member
40 Points
260 Posts
Unable to get user name
May 09, 2012 07:24 AM|LINK
Hi All,
I want to get the user name from the active directory.
I am using following code:
Here I am getting at error on highted line - 'user' is not reckon in the context class. "
Error 6 'System.Runtime.Remoting.Contexts.Context' does not contain a definition for 'User' "Context does not cotain defination of user"
Please suggest some way-out for this problem.