A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Wednesday, April 23, 2008

Detecting a Client's screen resolution and color depth in ASP.NET/Javascript

At times you might want to know how much screen real estate a user has before opening several new browser windows. You also might want to find out if they have a high-color display capable of showing a detailed color image. The following code shows how to learn the user's screen real estate and color depth. The total screen size includes unusable areas like the icon tray on Windows or the menubar on the Mac. The available screen size attributes subtract these system-reserved areas from the total screen size. For multi-screen systems, Internet Explorer will return the size of the monitor it is on, while Netscape returns the size of both monitors combined.

  <HTML> <HEAD> 	<TITLE>Detecting the user's hardware</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" ALINK="#6600FF" VLINK="#CC0000"> <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript"> 	<!-- 	document.writeln("Total Screen size = ", screen.width, " x ", screen.height); 	document.writeln("<P>"); 	document.writeln("Available Screen size = ", screen.availWidth, " x ", screen.availHeight); 	document.writeln("<P>"); 	document.writeln("Color depth = ", screen.colorDepth); 	//--> </SCRIPT> </BODY> </HTML>

No comments:

Post a Comment

Post your comments here:

Dotnet-Interviews