how to retrive user information

Hi

I have a web application in the local intranet. I want to retrive the logged-on username and information. WindowsPrincipal won't work and following code gave me an empty string.

 WindowsPrincipal myPrincipal;// Gets a reference to the current

myPrincipal = (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal;

WindowsIdentity myIdentity;// Gets the WindowsIdentity of the current principal

myIdentity = (WindowsIdentity)myPrincipal.Identity;

string username = myIdentity.Name;

 

thank you in advance


Read More

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s