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

Username

On windows NT, how do you obtain the username of the current person logged on.
0
kinross
Asked:
kinross
1 Solution
 
LiuCommented:
BOOL GetUserName
(
    LPTSTR lpBuffer, // address of name buffer
    LPDWORD nSize // address of size of name buffer
);
 

0
 
The MasterCommented:
Now THAT's efficient!!!  :-)

Windows98 has registry entries that you could probably use to get this...  

HKLM\Network\Logon\username
HKLM\System\CurrentControlSet\Control\Current User

I'm sure NT probably does somewhere too.  When you're logged on just search the registry for your username looking for something similar to "current user".

Good luck!

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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