Tuesday, December 11, 2007

Getting the client browser / system details through ASP.NET

HttpBrowserCapabilities bc=new HttpBrowserCapabilities();
bc=Request.Browser;
Response.Write(bc.Cookies.ToString());
Response.Write(bc.ActiveXControls.ToString());
Response.Write(bc.Platform.ToString());

Here HttpBrowserCapabilities is an class which is available in the system.web namespace ,first create an object and assign the client browser to it then we can get the details of the client browser with this the different property available

Response.Write( HttpContext.Current.Server.MachineName ) ;


This is used to get the client system name

No comments: