Display browser information in C#

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 1248
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class browser : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

System.Web.HttpBrowserCapabilities browserDetection = Request.Browser;
Response.Write("Browser type "+ browserDetection.Type+"<br>");
Response.Write("Browser name " + browserDetection.Browser + "<br>");
Response.Write("Browser version " + browserDetection.Version + "<br>");
Response.Write("Cookie support "+ browserDetection.Cookies.ToString());
Response.Write("Browser JavaScript Version"+ browserDetection.EcmaScriptVersion.ToString());

}
}

Comments or Responses

Login to post response