电脑上有火狐和IE浏览器,火狐是默认浏览器
如何获取火狐浏览器版本信息?高手指点,最好有代码贴出来

解决方案 »

  1.   

    通过注册表找到火狐的路径
      private void Form1_Load(object sender, EventArgs e)
            {
                System.Diagnostics.FileVersionInfo FileVer = System.Diagnostics.FileVersionInfo.GetVersionInfo(@"D:\Program Files\Mozilla Firefox\firefox.exe");
                MessageBox.Show(FileVer.FileVersion);
            }
      

  2.   

         private void Form1_Load(object sender, EventArgs e)
            {
                Microsoft.Win32.RegistryKey key =  Microsoft.Win32.Registry.ClassesRoot;
                Microsoft.Win32.RegistryKey key1 = key.OpenSubKey(@"http\shell\open\command", true);
                MessageBox.Show(key1.GetValue("").ToString());
            } 
      

  3.   

    "C:\Program Files\Internet Explorer\IEXPLORE.EXE" -nohome 
    上面是获取的结果,能获取到具体的版本号吗?
      

  4.   


    Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.ClassesRoot;
            Microsoft.Win32.RegistryKey key1 = key.OpenSubKey(@"http\shell\open\command",false);
            string fullPath = key1.GetValue("").ToString();
            int endIndex = fullPath.ToLower().IndexOf(".exe");
            string FileName = fullPath.Substring(1, endIndex).Replace(@"\","/") + "exe";
            System.Diagnostics.FileVersionInfo FileVer = System.Diagnostics.FileVersionInfo.GetVersionInfo(FileName);        Response.Write("<br />"+FileVer.FileName+"=========="+key1.GetValue("").ToString()+";=============<br />");
            Response.Write("FileVer.Comments--" + FileVer.Comments + "<br />");
            Response.Write("FileVer.CompanyName--" + FileVer.CompanyName + "<br />");
            Response.Write("FileVer.FileDescription--" + FileVer.FileDescription + "<br />");
            Response.Write("FileVer.FileMajorPart--" + FileVer.FileMajorPart + "<br />");
            Response.Write("FileVer.FileMinorPart--" + FileVer.FileMinorPart + "<br />");
            Response.Write("FileVer.FileName--" + FileVer.FileName + "<br />");
            Response.Write("FileVer.FilePrivatePart--" + FileVer.FilePrivatePart + "<br />");
            Response.Write("FileVer.FileVersion--" + FileVer.FileVersion + "<br />");
            Response.Write("FileVer.InternalName--" + FileVer.InternalName + "<br />");
            Response.Write("FileVer.OriginalFilename--" + FileVer.OriginalFilename + "<br />");
            Response.Write("FileVer.PrivateBuild--" + FileVer.PrivateBuild + "<br />");
            Response.Write("FileVer.ProductBuildPart--" + FileVer.ProductBuildPart + "<br />");
            Response.Write("FileVer.ProductMajorPart--" + FileVer.ProductMajorPart + "<br />");
            Response.Write("FileVer.ProductMinorPart--" + FileVer.ProductMinorPart + "<br />");
            Response.Write("FileVer.ProductName--" + FileVer.ProductName + "<br />");
            Response.Write("FileVer.ProductPrivatePart--" + FileVer.ProductPrivatePart + "<br />");
            Response.Write("FileVer.ProductVersion--" + FileVer.ProductVersion + "<br />");
            Response.Write("FileVer.SpecialBuild--" + FileVer.SpecialBuild + "<br />");
      

  5.   

    Microsoft.Win32.RegistryKey key1 = key.OpenSubKey(@"http\shell\open\command",true);好像沒權寫入,設成false獲取不正確