Tuesday, May 11, 2004

A useful piece of code I found on the Internet:

When you install .NET IE adds a header information in requests that are sent out.

So the following code:

Version verHave = Request.Browser.ClrVersion;
Version verNeed = new Version("1.0.3705");

if( verHave < verNeed ) ...

would help you detect the CLR version running on the client system through a web application. (The above code actually detects if the CLR version is 1.0.3705 or higher).

I can think of a few scenarios where this can be useful:

  • .NET Smart client apps which are usually loaded from a link on the web
  • The download link of your website where you are being nice enough to give away some free tools for download - but these run only on a particular CLR version and you want the *layman* to know that he has to first download the .NET runtime before downloading your application

 

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):