-
January 13th, 2009, 06:23 AM
#1
User Name from START menu? (not System.Environment.UserName)
Hi,
how can I obtain the name which is displayed on top of the Windows START menu?
Mike
-
January 13th, 2009, 07:31 AM
#2
Re: User Name from START menu? (not System.Environment.UserName)
First add System.DirectoryServices as reference to your project, next use the next code
Code:
string servername = Environment.UserDomainName;
string username = Environment.UserName;
using (System.DirectoryServices.DirectoryEntry domain = new
System.DirectoryServices.DirectoryEntry(string.Format("WinNT://{0}/{1}", servername, username))) {
string fullName = domain.Properties["FullName"].Value.ToString() ;
}
-
January 13th, 2009, 07:38 AM
#3
Re: User Name from START menu? (not System.Environment.UserName)
Last edited by MNovy; January 13th, 2009 at 07:40 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|