Saturday, 6 October 2012

Check whether Silverlight is installed in your system or not


Check whether Silverlight is installed in your system or not

Hi Friends,

In the below article i will tell you how to check whether silverlight is installed in your system or not.


Copy the below code and paste into the blank notepad file and save as "HTML" extension
after running the page click on Check Silverlight link.

<html>
<head>
<script language="javascript">
function ShowMessage()
{
 if(
checkSilverlight
()==true)
 {
  alert("SilverLight installed.");
 }
 else
 {
  alert("SilverLight Not installed.");
 }
}

function checkSilverlight()
{
var browser = navigator.appName; // Get browser
varsilverlightInstalled = false;
if (browser == 'Microsoft Internet Explorer')
{
    try
    {
        varslControl = new ActiveXObject('AgControl.AgControl');
        silverlightInstalled = true;


    }
    catch (e)
    {
        // Error. Silverlight not installed.
    }
}
else
{
    // Handle Netscape, FireFox, Google chrome etc
    try
    {
        if (navigator.plugins["Silverlight Plug-In"])
        {
            silverlightInstalled = true;
        }
    }
    catch (e)
    {
        // Error. Silverlight not installed.
    }
}
return silverlightInstalled;
//alert(silverlightInstalled);
}
</script>
</head>
<body>
<a href="javascript:void(ShowMessage())">Check Silverlight</a>
</body>
</html>


 Happy Programming ! !

If you have any query mail me to Sujeet.bhujbal@gmail.com     


Regards

Sujeet Bhujbal

------------------------------------------------------------------------------------------------------------











------------------------------------------------------------------------------------------------------------


0 comments :

Post a Comment