try
{
string userAgent = Request.UserAgent == null ? "无" : Request.UserAgent;
LblOS.Text=this.GetOSNameByUserAgent(userAgent);——通过下面的代码来获得用户的OS类型
LblIP.Text = Request.UserHostAddress; //获取IP
LblBrs.Text = Request.Browser.Browser + Request.Browser.Version; //获取浏览器的类型及版本号
LblLanguage.Text = Request.UserLanguages[0]; //获取用户操作系统的语言
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
|
请发表评论