Windows NT Authentication

  • Thread starter Thread starter Cheeku
  • Start date Start date
C

Cheeku

Hi,

I'm developing windows application and I want to use integrated windows
authentication in my application. I do not want to use a windows form
for entering username and domain details. I want to get the currently
logged in user details from my application.

Can you please guide me the way to fetch currently logged in user
details.

Thanks,
Cheeku
 
Hi,

Import following namespaces

using System.Security;
using System.Security.Principal;

and below code to get the domain and username

WindowsPrincipal wp = (WindowsPrincipal) Thread.CurrentPrincipal;
String result = wp.Identity.Name.ToString();

hope this would help you.

Cheers,
Kris
 
Back
Top