Hi Greg,
Thanks for posting in the community!
From your description, from your description, you'd like to get some
certain infos of the client user in the ASP.NET web application,yes?
If there is anything I misunderstood, please feel free to let me know.
As for this question, I think Kevin's suggestion that use the IIS's
ServerVariables Collection is a good approach since IIS server variables
provide information about a client, the request, and the application.
Server variables obtain most of their information from headers. It is wise
to not trust information in headers when security decisions must be made,
as this information can be falsified by malicious users. Here is the
weblink to its detailed description in MSDN:
#IIS Server Variables
http://msdn.microsoft.com/library/en-us/iissdk/iis/servervariables.asp?frame
=true
And since the example Kevin provided is classic ASP(vbscript) based, but
the "ServerVariables" collections is also avaliable in ASP.NET, for example:
private void Page_Load(object sender, System.EventArgs e)
{
foreach( string key in Request.ServerVariables.Keys )
{
Response.Write("<br>" + key + "::::::: " +
Request.ServerVariables[key].ToString());
Response.Write("<br>------------------------");
}
Response.Write("<br>------------------------");
Response.Write("<br>HttpContext.Current.User.Identity.Name: " +
HttpContext.Current.User.Identity.Name);
Response.Write("<br>Request.UserHostAddress: "+ Request.UserHostAddress );
Response.Write("<br>Request.UserHostName: "+ Request.UserHostName );
}
Also, there are some other approachs to get clientside info via clientside
script, here is some web links to some site or tech articles discussing on
this:
#Client-side Info
http://www.aspsimply.com/info/infoclient.asp
Hope they're helpful to you.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)