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

NT network - username

Is it possible using Delphi 1 or 2 to get the username of the user currently logged onto Win NT, e.g. using a Windows API function or samething like toat?
0
Christian_Wenz
Asked:
Christian_Wenz
  • 2
  • 2
1 Solution
 
ronit051397Commented:
var  FUser: array [0..100] of char;
     FLength: integer;
begin
  GetUserName(FUser,fLength);
  Showmessage(strpas(FUser))
end;

0
 
Christian_WenzAuthor Commented:
This works very well on a WinNT network, thanks a lot, but it won't work on a Win95 machine with a network card installed. Any hints for that? (on this machine, there is only one user with no password, so maybe you have to use another routine)
0
 
ronit051397Commented:
Sorry, I don't have 95 on my machine, I tested it only on NT. See:
http://x3.dejanews.com/getdoc.xp?AN=328736452&CONTEXT=904456544.614989851&hitnum=17
0
 
Christian_WenzAuthor Commented:
okay, thanks alot.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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