473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get full name of user

I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I
get the full display name (Chris Clement) as it is displayed in the start
menu in Windows XP?

Any help is appreciated.

Chris
Nov 15 '05 #1
2 6705
Chris,

You can call the GetUserNameEx API function through the P/Invoke layer
to get the display name. For the NameFormat parameter, you can pass the
value of NameDisplay from the EXTENDED_NAME_FORMAT enumeration (it has a
value of 3).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Clement" <ch**********@onlyonnewsgroup.com> wrote in message
news:OJ**************@tk2msftngp13.phx.gbl...
I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I
get the full display name (Chris Clement) as it is displayed in the start
menu in Windows XP?

Any help is appreciated.

Chris

Nov 15 '05 #2
Thanks for the reply, Nicholas. Do you know of any resource that can show
me how to use APIs like this in a c# program. Or could you give me an
example of its usage. thanks again.

Chris

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Oc******************@TK2MSFTNGP11.phx.gbl...
Chris,

You can call the GetUserNameEx API function through the P/Invoke layer
to get the display name. For the NameFormat parameter, you can pass the
value of NameDisplay from the EXTENDED_NAME_FORMAT enumeration (it has a
value of 3).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Clement" <ch**********@onlyonnewsgroup.com> wrote in message
news:OJ**************@tk2msftngp13.phx.gbl...
I am trying to get the full name of a user not logged into a network on
Windows 2000/XP. I know how to get the user name (cclement), but how do I get the full display name (Chris Clement) as it is displayed in the start menu in Windows XP?

Any help is appreciated.

Chris


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RCIC | last post by:
Trying to get a user's full name using ADSI. It works in our Win2000 Active Directory but fails when I try to get a user's full name from a trusted WinNT domain. The error is "Cannot create ActiveX...
4
by: Mike | last post by:
Greetings, I am writing an Intranet application in ASP.NET using VB.NET. I am obtaining the username of the user with: uName = User.Identity.Name, which is in the form of DOMAIN\username. I...
1
by: Jordan Bruce | last post by:
******************************************************* ONTARIO CANADA INFORMIX USER GROUP (OCIUG) http://www.iiug.org/ociug NEXT MEETING: WEDNESDAY, JULY 14...
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
0
by: Rob | last post by:
I need to allow a user with the default "Full Data User" permissions on the front-end database to relink to a table in a backend to which he has the same permissions. (I'd like to do read, update,...
2
by: Jesper | last post by:
Hi, I don't know if its possible, but I would like to get the full name of the user. Using string name = System.Environment.UserName; only gives me the login name of the user - however, when...
7
by: Jason Reichenbach | last post by:
I've GOT to be missing something painfully obvious, here... I need to programmatically get the full human name of the current user on a local system, the same system upon which the app is...
2
by: Bill nguyen | last post by:
I learned that I can use system.environment.username to get user login name. How can I get user full name/description from Active Directory or GAL? Thanks a million. Bill
3
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried...
2
by: m19peters | last post by:
We have a script that I had to rework a little bit for 2005 that does a full backup for every database on the server... For some reason on some nights the script does not backup all databases......
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.