Solved

network user name

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month3 days, 19 hours left to enroll

630 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