PC Review


Reply
Thread Tools Rate Thread

Check for .Net 2.0 framework

 
 
peterbf@gmail.com
Guest
Posts: n/a
 
      16th Nov 2005
I have a homepage where I instanciate a .Net 2.0 component in an object
tag, but before instanciating the component, I would like to to check
first if the machine has the .Net 2.0 framework installed.

Anyone who knows how/if I can do this in javascript?

 
Reply With Quote
 
 
 
 
Roman
Guest
Posts: n/a
 
      16th Nov 2005

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a homepage where I instanciate a .Net 2.0 component in an object
> tag, but before instanciating the component, I would like to to check
> first if the machine has the .Net 2.0 framework installed.
>
> Anyone who knows how/if I can do this in javascript?


<SCRIPT LANGUAGE="JavaScript">
<!--
CLRVersion = "1.1.4322";
function window:nload()
{
dnltxt="\n <a
href=\"http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-
bf8203e74006/dotnetfx.exe\">Download .Net Framework</a>";
if(HasRuntimeVersion(CLRVersion))
{
result.innerText = "You have correct version of CLR: " + CLRVersion;
}
else
{
result.innerText = "You don't have correct version of CLR: " + CLRVersion
+ "Please install it first!";
}
}

function HasRuntimeVersion(v)
{
var va = GetVersion(v);
var i;
var a = navigator.userAgent.match(/\.NET CLR [0-9.]+/g);
if(a != null)
{
for(i = 0; i < a.length; ++i)
{
if(CompareVersions(va, GetVersion(a[i])) <= 0)
{
return true;
}
}
}
return false;
}

function GetVersion(v)
{
var a = v.match(/([0-9]+)\.([0-9]+)\.([0-9]+)/i);
return a.slice(1);
}

function CompareVersions(v1, v2)
{
for(i = 0; i < v1.length; ++i)
{
var n1 = new Number(v1[i]);
var n2 = new Number(v2[i]);
if(n1 < n2)
{
return -1;
}
if(n1 > n2)
{
return 1;
}
}
return 0;
}
-->
</SCRIPT>

 
Reply With Quote
 
peterbf
Guest
Posts: n/a
 
      17th Nov 2005
Thanks alot, this is does exactly what I wants.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I check framework version ? FC Microsoft Dot NET Framework 3 23rd Oct 2008 08:51 PM
Check for .NET Framework =?Utf-8?B?ZVNvbFRlYywgSW5jLiA1MDEoYykoMyk=?= Microsoft VB .NET 2 12th Oct 2006 10:08 AM
How do I check the vesrion of .NET Framework? A.M-SG Microsoft C# .NET 4 17th Dec 2005 08:23 PM
CHECK constraint in .NET framework Greg Allen Microsoft ADO .NET 1 18th Jul 2005 07:59 PM
run asp.net from CD and check .net framework Andrew Microsoft ASP .NET 2 3rd Sep 2004 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:37 AM.