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. Retrieving Windows Login

Retrieving Windows Login

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasesecurity
4 Posts 4 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.
  • R Offline
    R Offline
    robw1888
    wrote on last edited by
    #1

    Hi all I've created a ASP.NET/VB.NET intranet application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record. I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username? Many Thanks

    Rob

    N K V 3 Replies Last reply
    0
    • R robw1888

      Hi all I've created a ASP.NET/VB.NET intranet application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record. I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username? Many Thanks

      Rob

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      System.Security.Principal.WindowsIdentity.Name


      only two letters away from being an asset

      1 Reply Last reply
      0
      • R robw1888

        Hi all I've created a ASP.NET/VB.NET intranet application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record. I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username? Many Thanks

        Rob

        K Offline
        K Offline
        kiran kumar Intelligroup
        wrote on last edited by
        #3

        Hi Rob, Using this 'Environment.UserName' also you will get windows username.

        Kiran Kumar.CH (MCP)

        1 Reply Last reply
        0
        • R robw1888

          Hi all I've created a ASP.NET/VB.NET intranet application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record. I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username? Many Thanks

          Rob

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          dim wp as WindowsPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent()) Response.Write(wp.Identity.Name) Source: http://www.syncfusion.com/FAQ/aspnet/WEB_c17c.aspx[^]

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          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