sacvb
asked on
How to get windows user ID in C# web application (asp.net 2.0)?
How to get windows user ID in C# web application?
To clarify, I am talking about login ID that user uses to login to his working machine. (he/she has to press Ctrl-Alt-Del and enter login and password to start working)
I was looking around and one of the suggestion was to use: System.Environment.UserNam e;
But, this gives (by my opinion) account name under which the application is logged to the server that hosts application. In my case I get "ASPNET" and that is not my windows ID.
I assume that for this I will have to connect to Active Directory. How can I do that and how to query Active Directory. Thanks.
To clarify, I am talking about login ID that user uses to login to his working machine. (he/she has to press Ctrl-Alt-Del and enter login and password to start working)
I was looking around and one of the suggestion was to use: System.Environment.UserNam
But, this gives (by my opinion) account name under which the application is logged to the server that hosts application. In my case I get "ASPNET" and that is not my windows ID.
I assume that for this I will have to connect to Active Directory. How can I do that and how to query Active Directory. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
string authUser = Page.User.Identity.Name;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all