UserName!
-
I want to Get the name of a user of my web site so I'm using this code but I'm getting errors: string DomainUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace("\\","/"); System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://"+DomainUser); string Fullname = ADEntry.Properties("FullName").Value; and the error is: 1:The type or namespace name 'DirectoryServices' does not exist in the class or namespace 'System' (are you missing an assembly reference?) 2:The type or namespace name 'ADEntry' could not be found (are you missing a using directive or an assembly reference?) What could be the problem? Thanks.
-
I want to Get the name of a user of my web site so I'm using this code but I'm getting errors: string DomainUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace("\\","/"); System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://"+DomainUser); string Fullname = ADEntry.Properties("FullName").Value; and the error is: 1:The type or namespace name 'DirectoryServices' does not exist in the class or namespace 'System' (are you missing an assembly reference?) 2:The type or namespace name 'ADEntry' could not be found (are you missing a using directive or an assembly reference?) What could be the problem? Thanks.
Imports System.DirectoryServices
I see you are taking some advice from my reply but also noticed that you posted multiple times, please dont do that.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy)
"Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School) -
Imports System.DirectoryServices
I see you are taking some advice from my reply but also noticed that you posted multiple times, please dont do that.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy)
"Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)