ASP.NET 2.0 - Get the Username of the currently logged in user.

How do i get the username of the user who is currently logged in to the pc in ASP.NET 2.0? I'm doing a small web forms APP and need to put the username into a Label control. The user is logged into the Windows account which is a client pc on the active directory network.
sergeiweerasuriyaAsked:
Who is Participating?
 
sakshi_netCommented:
Following will give you the Username of Currently Logged In User
--------------------------------------------------------------------------------
Dim UserName As String
        UserName = User.Identity.Name.ToString()
         MsgBox(UserName)

--------------------------------------------------------------------------------
Full path hierarchy including the Namespace path

System.Web.HttpContext.Current.User.Identity.Name
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.