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 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
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
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
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
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
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
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 >> >> >> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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'
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |