Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get the logged in user's name ? 2

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi All

Can someone tell me how to get the login/username of the current windows session?

I'm using W2k and Delphi 5.

big ta
lou
 
weez,

As MikeEd points out, you'll want to use getUserName for this (sample at
However, if you need to know whether or not the current user has administration rights, you'll also want to take a peek at which expands upon an article on Borland's site. (Borland's articles leaves out a couple of tidbits.)

Note that you need to verify you're running under NT before calling the isAdmin code.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top