Retrieve username
How can i retrieve the username in Windows Authentication?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 26, 2012, 8:13 PM EST
using System.Web.Security;
string username = User.Identity.Name.ToString();
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted Feb 28, 2012, 10:56 PM EST
You can get from this statement
System.Environment.UserName.ToString();
System.Environment.UserDomainName.ToString();
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 29, 2012, 12:50 AM EST
please refer,
http://www.codeproject.com/Articles/37558/Windows-Authentication-Using-Form-Authentication
http://weblogs.asp.net/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Windows-Authentication-within-an-Intranet-ASP.NET-Web-application.aspx
very good article on Windows Authentication