Solved

network user name

Posted on 2001-07-14
3
166 Views
Last Modified: 2010-04-06
i want to get to my user name of the network.

please help me
0
Comment
Question by:eebeginer
3 Comments
 
LVL 1

Accepted Solution

by:
drnadeem earned 200 total points
ID: 6281821
var
 PUserName: PChar;
 PComputerName: PChar;
 Size: LongWord;
begin
 Size:= 100;
 PUserName:= StrAlloc(100);
 PComputerName:= StrAlloc(100);

 if GetUserName(PUserName, Size) then
   Label1.Caption:= PUserName
 else
   Label1.Caption:= 'There is no logged user';

 Size:= 100;
 if GetComputerName(PComputerName, Size) then
   Label2.Caption:= PComputerName
 else
   Label2.Caption:= 'Error while getting computer name';

 StrDispose(PUserName);
 StrDispose(PComputerName);

hope this helps you
0
 

Author Comment

by:eebeginer
ID: 6281852
Thank you for the quick reply.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6281947
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now