Are you trying to get the get the Windows Login Username and Time last logged in, OR are you trying to find the username and last login for an ASP.NET based custom login system?
If you are trying to find the username and last login for a custom login system, the easiest way to do it is to set a session variable and assign those 2 to it on the "login" page.
If you are trying to find the user's domain information however, Here is a complete list of Server Variables:
To print out what's in all of them on the page, just do:
C-Sharp Version:
csharp Code:
string lsServerVariableName = "";
foreach ( lsServerVariableName in Request.ServerVariables.AllKeys)
{
Response.Write(lsServerVariableName + ": " + Request.ServerVariables(lsServerVariableName) + "<br />");
}
Response.Write("<br />");
Or in VB.NET:
vb.net Code:
Dim lsServerVariableName As String = ""
For Each lsServerVariableName In Request.ServerVariables.AllKeys
Response.Write(lsServerVariableName & ": " & Request.ServerVariables(lsServerVariableName) & "<br />")
Next
Response.Write("<br />")
The one you want is "LOGON_USER".
Pete