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???

nevermind, found it

string strUsr = UserPrincipal.Current.GivenName;
        MessageBox.Show(strUsr);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.