Windows Application WindowsIdentity.GetCurrent().Name- Get only UserName and not Domain

Last Reply on Oct 09, 2012 08:33 AM By Mudassar

Posted on Oct 09, 2012 08:33 AM

hi

I am writing this code

LBEmpName.Text = WindowsIdentity.GetCurrent().Name;

 

But i want to display only user name wt should i do.

Posted on Oct 09, 2012 08:33 AM
  string s = WindowsIdentity.GetCurrent().Name.Split('\\')[1];