Solved

network user name

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

821 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