Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

network user name

Posted on 2001-07-14
3
Medium Priority
?
177 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
[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
3 Comments
 
LVL 1

Accepted Solution

by:
drnadeem earned 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

670 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