Solved

network user name

Posted on 2001-07-14
3
165 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

11 Experts available now in Live!

Get 1:1 Help Now