Solved

NT network - username

Posted on 1998-08-27
4
204 Views
Last Modified: 2010-04-04
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
Comment
Question by:Christian_Wenz
[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
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1337932
var  FUser: array [0..100] of char;
     FLength: integer;
begin
  GetUserName(FUser,fLength);
  Showmessage(strpas(FUser))
end;

0
 
LVL 5

Author Comment

by:Christian_Wenz
ID: 1337933
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
 
LVL 5

Expert Comment

by:ronit051397
ID: 1337934
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
 
LVL 5

Author Comment

by:Christian_Wenz
ID: 1337935
okay, thanks alot.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month5 days, 21 hours left to enroll

627 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