<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Test for check OS version and NET Framework version</title>

 

 

<script language="javascript">

 function dotnet()

   {

   var ag = navigator.userAgent;

var msg="";

if(navigator.platform == "Win16" )var os= "Windows 3.1";

if(navigator.platform == "Mac" ) os = "MacOS";

if(navigator.platform == "Win32") os = "Windows 95 or above";

if(navigator.platform == "Win64") os = "Windows NT 5.1.2600";

//document.write ( "Operating system is " + os);

msg="platform is " +navigator.platform+"\n"

+"Operating system is "+os+"\n"

+"Appversion is "+navigator.appVersion+"\n";

   if (ag.indexOf("IE")!=-1)

   {

  if (ag.indexOf("NET CLR") != -1)

  {

  if (ag.indexOf("NET CLR 1.0")!= -1) 

  {

  //document.write(".net Framework version 1.0 found.<br/>");

msg+=".net Framework version 1.0 found.\n";

  }

  if (ag.indexOf("NET CLR 1.1")!= -1) 

  {

  //document.write(".net Framework Version 1.1 found.<br/>");

msg+=".net Framework Version 1.1 found.\n";  

  }

 

if (ag.indexOf("NET CLR 2")!= -1) 

  {

  //document.write(".net Framework Version 2.0 found.<br/>");

  msg+=".net Framework Version 2.0 found.\n";

  }

if (ag.indexOf("NET CLR 3.0")!= -1) 

  {

  //document.write(".net Framework Version 3.0 found.<br/>");

  msg+=".net Framework Version 3.0 found.\n";

  }

if (ag.indexOf("NET CLR 3.5")!= -1) 

  {

  //document.write(".net Framework Version 3.5 found.<br/>");

  msg+=".net Framework Version 3.5 found.\n";

  }

  }

  else

  {

  //document.write("No .net Framework found.<br/>Please install the .net Framework.");

msg+="No .net Framework found.\nPlease install the .net Framework.\n";

  }

}

 

else

{

//document.write("The automatic detection of the .net framework only works in Internet Explorer.");

msg+="The automatic detection of the .net framework only works in Internet Explorer.\n";

}

var obj = document.getElementById('content');

obj.value=msg;

}

</script>

</head>

 

<body >

<input type="button" onclick="dotnet()" value="checkversion" />

<br />

<textarea name="content" cols="100" rows="10" id="content">

</textarea>

</body>

</html>

狼翔月影 發表在 痞客邦 PIXNET 留言(0) 人氣()