473,382 Members | 1,615 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,382 software developers and data experts.

Finding the full human name of a system user

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 running.

Using C#.NET MSDEV2003. OS will be Win2K or WinXP.

I've found numerous ways to get the user name, but have yet to find the way
to get the human name.

Anybody have any wisdom here?

Many thanks in advance,
Jason
Nov 23 '05 #1
7 1883
I think System.Environment.UserName
is what you're after...

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
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 running.

Using C#.NET MSDEV2003. OS will be Win2K or WinXP.

I've found numerous ways to get the user name, but have yet to find the
way
to get the human name.

Anybody have any wisdom here?

Many thanks in advance,
Jason

Nov 23 '05 #2
You can't get anything that is not stored in the system. Unless the users
full name is entered in somewhere as part of being a user.

If you are connected to a network via something like Active Directory then
you can query the catalog for the users name as it is entered in there.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
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 running.

Using C#.NET MSDEV2003. OS will be Win2K or WinXP.

I've found numerous ways to get the user name, but have yet to find the
way
to get the human name.

Anybody have any wisdom here?

Many thanks in advance,
Jason

Nov 23 '05 #3
I thought so, too, but sadly that gives me the user name, as does
SystemInformation.UserName...

"Lloyd Dupont" wrote:
I think System.Environment.UserName
is what you're after...

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
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 running.

Using C#.NET MSDEV2003. OS will be Win2K or WinXP.

I've found numerous ways to get the user name, but have yet to find the
way
to get the human name.

Anybody have any wisdom here?

Many thanks in advance,
Jason


Nov 23 '05 #4
Well, the information is available, I'm just missing the mechanism for
getting it. What I'm looking for shows up in the Local Users and Groups
section of the Computer Management app that is part of the Administrative
Tools in Control Panel (this is on Win2K). I understand that if the user
chooses to leave this blank when the user account is created then there would
be nothing to retrieve from here, but my test system has data in this field.

Thanks for the input... the data is definitely available (the Computer
Management app can find it... :) ), so it sure seems that other apps should
be able to do so... I'll keep digging.

"Ray Cassick (Home)" wrote:
You can't get anything that is not stored in the system. Unless the users
full name is entered in somewhere as part of being a user.

If you are connected to a network via something like Active Directory then
you can query the catalog for the users name as it is entered in there.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
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 running.

Using C#.NET MSDEV2003. OS will be Win2K or WinXP.

I've found numerous ways to get the user name, but have yet to find the
way
to get the human name.

Anybody have any wisdom here?

Many thanks in advance,
Jason


Nov 23 '05 #5
Just located this via Google:

Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\", "/")
Dim ADEntry As New System.DirectoryServices.DirectoryEntry("WinNT://" &
DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
Have not tried it yet... might work, might not.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:97**********************************@microsof t.com...
Well, the information is available, I'm just missing the mechanism for
getting it. What I'm looking for shows up in the Local Users and Groups
section of the Computer Management app that is part of the Administrative
Tools in Control Panel (this is on Win2K). I understand that if the user
chooses to leave this blank when the user account is created then there
would
be nothing to retrieve from here, but my test system has data in this
field.

Thanks for the input... the data is definitely available (the Computer
Management app can find it... :) ), so it sure seems that other apps
should
be able to do so... I'll keep digging.

"Ray Cassick (Home)" wrote:
You can't get anything that is not stored in the system. Unless the users
full name is entered in somewhere as part of being a user.

If you are connected to a network via something like Active Directory
then
you can query the catalog for the users name as it is entered in there.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
> 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 running.
>
> Using C#.NET MSDEV2003. OS will be Win2K or WinXP.
>
> I've found numerous ways to get the user name, but have yet to find the
> way
> to get the human name.
>
> Anybody have any wisdom here?
>
> Many thanks in advance,
> Jason


Nov 23 '05 #6
Thanks, Ray... I saw that one too, and didn't try it because I had hopes of a
simpler (not going to a network) solution...

This does work, though, so I'll use it for now...

I appreciate the help.

Jason

"Ray Cassick (Home)" wrote:
Just located this via Google:

Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\", "/")
Dim ADEntry As New System.DirectoryServices.DirectoryEntry("WinNT://" &
DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
Have not tried it yet... might work, might not.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:97**********************************@microsof t.com...
Well, the information is available, I'm just missing the mechanism for
getting it. What I'm looking for shows up in the Local Users and Groups
section of the Computer Management app that is part of the Administrative
Tools in Control Panel (this is on Win2K). I understand that if the user
chooses to leave this blank when the user account is created then there
would
be nothing to retrieve from here, but my test system has data in this
field.

Thanks for the input... the data is definitely available (the Computer
Management app can find it... :) ), so it sure seems that other apps
should
be able to do so... I'll keep digging.

"Ray Cassick (Home)" wrote:
You can't get anything that is not stored in the system. Unless the users
full name is entered in somewhere as part of being a user.

If you are connected to a network via something like Active Directory
then
you can query the catalog for the users name as it is entered in there.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:0D**********************************@microsof t.com...
> 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 running.
>
> Using C#.NET MSDEV2003. OS will be Win2K or WinXP.
>
> I've found numerous ways to get the user name, but have yet to find the
> way
> to get the human name.
>
> Anybody have any wisdom here?
>
> Many thanks in advance,
> Jason


Nov 23 '05 #7
You don't necessarily need a network to do this.

The WinNT provider should be able to be used to reach local account data on
a standalone system.

I *think*.
"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:2D**********************************@microsof t.com...
Thanks, Ray... I saw that one too, and didn't try it because I had hopes
of a
simpler (not going to a network) solution...

This does work, though, so I'll use it for now...

I appreciate the help.

Jason

"Ray Cassick (Home)" wrote:
Just located this via Google:

Dim DomainUser As String =
System.Security.Principal.WindowsIdentity.GetCurre nt.Name.Replace("\",
"/")
Dim ADEntry As New System.DirectoryServices.DirectoryEntry("WinNT://" &
DomainUser)
Dim FullName As String = ADEntry.Properties("FullName").Value
Have not tried it yet... might work, might not.

"Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote in
message news:97**********************************@microsof t.com...
> Well, the information is available, I'm just missing the mechanism for
> getting it. What I'm looking for shows up in the Local Users and Groups
> section of the Computer Management app that is part of the
> Administrative
> Tools in Control Panel (this is on Win2K). I understand that if the
> user
> chooses to leave this blank when the user account is created then there
> would
> be nothing to retrieve from here, but my test system has data in this
> field.
>
> Thanks for the input... the data is definitely available (the Computer
> Management app can find it... :) ), so it sure seems that other apps
> should
> be able to do so... I'll keep digging.
>
>
>
> "Ray Cassick (Home)" wrote:
>
>> You can't get anything that is not stored in the system. Unless the
>> users
>> full name is entered in somewhere as part of being a user.
>>
>> If you are connected to a network via something like Active Directory
>> then
>> you can query the catalog for the users name as it is entered in
>> there.
>>
>> "Jason Reichenbach" <Ja**************@discussions.microsoft.com> wrote
>> in
>> message news:0D**********************************@microsof t.com...
>> > 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 running.
>> >
>> > Using C#.NET MSDEV2003. OS will be Win2K or WinXP.
>> >
>> > I've found numerous ways to get the user name, but have yet to find
>> > the
>> > way
>> > to get the human name.
>> >
>> > Anybody have any wisdom here?
>> >
>> > Many thanks in advance,
>> > Jason
>>
>>
>>


Nov 24 '05 #8

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

Similar topics

4
by: Hal Vaughan | last post by:
I want to have a config file for my program, which means I need to know where the config file is. If I type: java myclass and it runs myclass.class, is there any way to obtain the location of...
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...
7
by: Mark | last post by:
Hello; Here is what I wish to do: Click on a PDF link and have it open as a full screen window - not as a predetermined size. Sounds simple? I want to run the command from within the...
4
by: m | last post by:
Hello I need to find out full URL of my application name, I tried using Request.ServerVariables but it returns only serverername, and I need virtual directory name as well. Thnx in advance
2
by: Extremest | last post by:
Here is the code I have so far. It connects to a db and grabs headers. It then sorts them into groups and then puts all the complete ones into another table. Problem I am having is that for some...
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
5
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.