zoukankan      html  css  js  c++  java
  • 通过注册表检查本地office excel版本

                RegistryKey rk = Registry.LocalMachine;
                RegistryKey key03 = rk.OpenSubKey(@"SOFTWARE\\Microsoft\\Office\\11.0\\Word\\InstallRoot\\");
                RegistryKey key07 = rk.OpenSubKey(@"SOFTWARE\\Microsoft\\Office\\12.0\\Word\\InstallRoot\\");
                //检查本机是否安装Office2003
                if (key03 != null)
                {
                    //读取offcie03的版本
                    string file03 = key03.GetValue("Path").ToString();
                    if (File.Exists(file03 + "EXCEL.exe"))
                    {
                        _OfficeVersion = "11.0";
                    }
                }
                //检查本机是否安装Office2007
                if (key07 != null)
                {
                    //读取offcie07的版本
                    string file07 = key07.GetValue("Path").ToString();
                    if (File.Exists(file07 + "EXCEL.exe"))
                    {
                        _OfficeVersion = "12.0";
                    }
                }
  • 相关阅读:
    【重点】Java大厂面试10个知识点汇总
    TEC-2机微程序设计
    Component 'TABCTL32.OCX'错误的处理方法
    Azure DevOps的使用入门
    Mac + VMware Fusion + Windows 11尝鲜
    Golang接口类型-下篇
    Golang接口类型-上篇
    基于Python实现原生的登录验证码
    一套帮助你理解C语言的测试题(转)
    KMP算法详解
  • 原文地址:https://www.cnblogs.com/swarb/p/9924453.html
Copyright © 2011-2022 走看看