Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. UserName!

UserName!

Scheduled Pinned Locked Moved ASP.NET
helpsecurityquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nclauder
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • N nclauder

      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.

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      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)

      N 1 Reply Last reply
      0
      • M Marcus J Smith

        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)

        N Offline
        N Offline
        nclauder
        wrote on last edited by
        #3

        Hi, Thanks CLEAKO I won't do it again. Yo code Advice worked. Thanks again.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups