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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. user in computer

user in computer

Scheduled Pinned Locked Moved .NET (Core and Framework)
windows-adminquestion
3 Posts 3 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.
  • S Offline
    S Offline
    sebastianos
    wrote on last edited by
    #1

    How I can see what user open session in a computers of a domain (without Active Directory)? Thank Sory for my english.

    L O 2 Replies Last reply
    0
    • S sebastianos

      How I can see what user open session in a computers of a domain (without Active Directory)? Thank Sory for my english.

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

      Hi! If you are using a windows system, you just need to use the win32-api GetUserName: Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, ByRef nSize As Integer) As Integer Public Function GetCurrentUser() As String Dim liReturn As Integer Dim lsUserName As String lsUserName = New String(CChar(" "), 250) liReturn = GetUserName(lsUserName, 250) GetCurrentUser= lsUserName.Substring(0, lsUserName.IndexOf(Chr(0))) End Function The imported function GetUserName require two parameters: 1. The destination string-buffer for output 2. The size of the username Then, with substring and indexof, we cut all character "0" off and return the username. Marcel Erz

      1 Reply Last reply
      0
      • S sebastianos

        How I can see what user open session in a computers of a domain (without Active Directory)? Thank Sory for my english.

        O Offline
        O Offline
        oykica
        wrote on last edited by
        #3

        You can get the user name associated with the current thread using SystemInformation.UserName.

        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