• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3397
  • Last Modified:

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.
0
sergeiweerasuriya
Asked:
sergeiweerasuriya
  • 2
2 Solutions
 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now