GET THE USER NAME IN C# FOR NT AUTHENTICATION

Labels:

//Declare the Header File

using System.Security.Principal;
string a;

a=System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();

//Above Statement,opens us up to more than just the current user.

MessageBox.Show(a.ToString());

0 comments:

Post a Comment