web程序,怎么获得浏览网页的机器是否安装.Net,最好能获得.net的版本。
纯真网络的ip小秘书我试了下,是能获得的,见网页http://www.cz88.net/ip/default.aspx
请问该怎么实现?能不能获得浏览用户的的.net版本是否在2.0以上?

解决方案 »

  1.   

    3.5 的.net强奸了 firefox, 使得 ff 发出的请求在头部 Client 部分包含了 .net CLR 之类的字样.微软自家的IE更不用说了.
      

  2.   

    记错了, 是 
    User-Agent 
    这个不保险, 因为浏览器种类太多
      

  3.   

    Firefox 浏览时:机器没有安装 3.5 net , ff 没有被强奸
    HTTP_USER_AGENT  Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 安装3.5net, ff 被奸, 不过网上有反奸的方法.IE 6.0HTTP_USER_AGENT  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)  
      

  4.   

    http://msdn.microsoft.com/zh-cn/library/ms749404.aspx
      

  5.   

    浏览网页的机子有必要装.net framework吗,想强奸客户端浏览器?
      

  6.   

       
    好了,在各位的启发下,完工了。protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    string userAgent= Request.UserAgent.ToString();
                    int net = GetDotNet(userAgent);
                }
            }
          private int GetDotNet(string userAgent)
            {
                if (userAgent.Contains(".NET CLR 4"))
                {
                    return 4;
                }
                if (userAgent.Contains(".NET CLR 3.5"))
                {
                    return 35;
                }
                if (userAgent.Contains(".NET CLR 3.0"))
                {
                    return 30;
                }
               if (userAgent.Contains(".NET CLR 2.0"))
                {
                    return 20;
                }
              if (userAgent.Contains(".NET CLR 1"))
                {
                    return 10;
                }
              if (userAgent.Contains(".NET"))
                {
                    return 0;
                }
              
                return -1;
            } 
      

  7.   

    对于安装了mono的,浏览器user-agent体现不出来。
      

  8.   

    被奸了的 Firefox 的 UserAgentMozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)