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
Solved

NT network - username

Posted on 1998-08-27
4
202 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

828 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