Help - Please Help Get Windows User
need the user from windows, so i can ot get that because when i use Environment.UserName it returns ASP.net, i do not want that, i want the user that made a logon on windows, so if exists an API from windows that returns that, or any class from asp.net, please help me.
tim dinhPosted Oct 27, 2005, 3:16 AM
Nikesh GuptaPosted Oct 18, 2005, 6:18 AM
sample code -
// use namespace
using System.Security.Principal
// place this code where you want to find windows current user name
string a ;
a = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();