Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Username

Posted on 1999-06-29
2
Medium Priority
?
265 Views
Last Modified: 2013-11-20
On windows NT, how do you obtain the username of the current person logged on.
0
Comment
Question by:kinross
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
Liu earned 150 total points
ID: 1308391
BOOL GetUserName
(
    LPTSTR lpBuffer, // address of name buffer
    LPDWORD nSize // address of size of name buffer
);
 

0
 
LVL 2

Expert Comment

by:The Master
ID: 1308392
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question