0

Hi all,

When i run my application on mysystem/localhost it gives me correct username. but when i host my application on IIS and then open application on other user's pc then it should show that pc's username. but it doesn't.

how to retrieve username of that pc?

thanks

3
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by JorgeM
0

Hi pritaeas,

i had used below codes to get username after hosting site on IIS.

if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {
                string userName = "Hello, " + System.Web.HttpContext.Current.User.Identity.Name;
            }

string ddd = System.Net.Dns.GetHostName();

string s = Page.User.Identity.Name;

string sss= System.Environment.UserName;

string test= HttpContext.Current.Request.LogonUserIdentity.ToString();

except these are there any other solutions?

thanks.
kk

0

On the IIS server, Did you disable "Anonymous Authentication" and enabled "Windows Authentication" for that website?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.