JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
Okay,
Well, when you pull down the start menu in XP it Usually prints your name right at the top of the menu. I believe it's the same name that is in the "Full Name" field of the Add User dialog. However, of course, on my current work computer there is no "local" account, as I'm logged onto a full network, etc, and so I'm going through a domain of some sort. (Don't know too much about that stuff, and frankly don't really care.)
However, I did look up and found some information about requesting the full user name. (not just your login user name). For example:
Thomas Thumb logs in as : tthumb
Start menu it says: Thumb, Thomas
Email Account: 99thutho
So in effect to do certain things in my application it is rather imperative to retrieve the current users "Full Name"
This is how I am currently doing it:
Don't both with the NameStruct, it is simply a parser to determine First Name and Last Name.
Now the problem with this is that when My computer is not connected to the network I get an Exception at the line:
Which makes some sense, but also is somewhat amusing, because when I disconnect from the network (and my laptop goes into standby with the lid down so i can take it home), I later open the lid and log back in and everything is the same, so It still has the information of "Thumb, Thomas" on the start bar, even though I'm no longer connected to the current network. So how can i ask this computer, (not some network service) for the current users Full Name.
Thanks
Well, when you pull down the start menu in XP it Usually prints your name right at the top of the menu. I believe it's the same name that is in the "Full Name" field of the Add User dialog. However, of course, on my current work computer there is no "local" account, as I'm logged onto a full network, etc, and so I'm going through a domain of some sort. (Don't know too much about that stuff, and frankly don't really care.)
However, I did look up and found some information about requesting the full user name. (not just your login user name). For example:
Thomas Thumb logs in as : tthumb
Start menu it says: Thumb, Thomas
Email Account: 99thutho
So in effect to do certain things in my application it is rather imperative to retrieve the current users "Full Name"
This is how I am currently doing it:
VB.NET:
Dim DomainUser As String = My.User.Name.Replace("\", "/")
Dim ADEntry As New System.DirectoryServices.DirectoryEntry("WinNT://" & DomainUser)
_userfull = New NameStruct(ADEntry.Properties("FullName").Value)
Now the problem with this is that when My computer is not connected to the network I get an Exception at the line:
VB.NET:
ADEntry.Properties("FullName").Value
Which makes some sense, but also is somewhat amusing, because when I disconnect from the network (and my laptop goes into standby with the lid down so i can take it home), I later open the lid and log back in and everything is the same, so It still has the information of "Thumb, Thomas" on the start bar, even though I'm no longer connected to the current network. So how can i ask this computer, (not some network service) for the current users Full Name.
Thanks