vu3lmg
asked on
How to find current Windows User \
I have a web application in ASP.NET
I am using Forms Authentication with AD.
On the login screen I want to fill in the current windows user's name in the login form.
How do I do this ?
I am using Forms Authentication with AD.
On the login screen I want to fill in the current windows user's name in the login form.
How do I do this ?
ASKER
Dear Seaton007
I am using C#, which "using ..." includes this "WScript.NetWork" class ?
-VU3LMG
I am using C#, which "using ..." includes this "WScript.NetWork" class ?
-VU3LMG
Use
http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx
HttpContext.Current.User.Identity
http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx
ASKER
Dear informaniac
VU3LMG
HttpContext.Current.User.Identity
is returning blank, what could be the reason ?VU3LMG
ASKER
Just FYI I am using "Forms Authentication with AD user"
not "Windows Authentication"
When I use "Environment.UserName" it returns "NETWORK SERVICE".
VU3LMG
not "Windows Authentication"
When I use "Environment.UserName" it returns "NETWORK SERVICE".
VU3LMG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Contaced an expert and got the advise as mentioned in the solution above.
Open in new window