0

Hi All,

I'm trying to return my username in c#, but my Fullname... like John Smith.

Right now I am only getting mt actual login to windows, does anyone know how to do this?

string strUsr = WindowsIdentity.GetCurrent().Name.ToString(); 
MessageBox.Show(strUsr);

Environoment.username also brings back login... not full name

any suggestions???

Edited by pyTony: fixed formating

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by solarissf
0

nevermind, found it

string strUsr = UserPrincipal.Current.GivenName;
        MessageBox.Show(strUsr);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.