This code will help you to fetch the .NET versions installed on the client browser.
/* Author: Praveen */
< %@ Page Language="c#" ContentType="text/html" %>
< %
string useragent = Request.ServerVariables["HTTP_USER_AGENT"];

System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(".NET CLR [0-9.]*");
bool flag = false;
foreach (Match m in r.Matches(useragent))
{
Response.Write("

  • ” + m.Value.Replace(”CLR”, “Framework”));
    flag = true;
    }
    if (!flag)
    {
    Response.Write(”You have NO .NET frameworks installed”);
    }
    %>
  • Result will be somewhat like:

  • .NET Framework 2.0.50727
  • .NET Framework 1.1.4322
  • .NET Framework 3.0.04506.30
  • VN:F [1.1.6_502]
    Rating: 4.0/5 (1 vote cast)
    Share:
    • Digg
    • del.icio.us
    • Facebook
    • Google
    • DotNetKicks
    • LinkedIn
    • Live
    • MySpace
    • StumbleUpon
    • Technorati

    Related posts:

    1. Strip SQL Comments using RegularExpression with C#
    2. Checkbox - Check All, None
    3. Download any file from ASP.NET
    4. How to access items in a GridView?
    5. How to display string in webBrowser Control