We’ll not discover another Americas, but this is easy:

With the Razor Engine, put this on View:

@{
string luser = User.Identity.Name.Split('\\')[1];
}

You're logged in as @luser

Or use this on Controller:

string luser = User.Identity.Name.Split('\\')[1];

Remember that you must use the Windows Authentication, in other cases, you’ll get an empty string.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *