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. General Programming
  3. C#
  4. Getting the User Information Who is Login Into the Computer

Getting the User Information Who is Login Into the Computer

Scheduled Pinned Locked Moved C#
csharphelpquestion
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.
  • C Offline
    C Offline
    Chetan Ranpariya
    wrote on last edited by
    #1

    HI Friends, I have a problem regarding, Users of the Computer. See, i have to find out the User which is currently login with the System through C#.NET How i am getting to this? Please if u have a solution then reply this.

    A L A 3 Replies Last reply
    0
    • C Chetan Ranpariya

      HI Friends, I have a problem regarding, Users of the Computer. See, i have to find out the User which is currently login with the System through C#.NET How i am getting to this? Please if u have a solution then reply this.

      A Offline
      A Offline
      Andrew Lygin
      wrote on last edited by
      #2

      Hi, see Environment.UserName.

      1 Reply Last reply
      0
      • C Chetan Ranpariya

        HI Friends, I have a problem regarding, Users of the Computer. See, i have to find out the User which is currently login with the System through C#.NET How i am getting to this? Please if u have a solution then reply this.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        The easiest way is to use Environment.UserName But if you logged in in a domain server, then you must use this one to see the domain. For example MYDOMAIN\myusername

        WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
        Console.WriteLine(wp.Identity.Name);

        1 Reply Last reply
        0
        • C Chetan Ranpariya

          HI Friends, I have a problem regarding, Users of the Computer. See, i have to find out the User which is currently login with the System through C#.NET How i am getting to this? Please if u have a solution then reply this.

          A Offline
          A Offline
          albCode
          wrote on last edited by
          #4

          Request.ServerVariables["LOGON_USER"];

          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