• 导出Excel之判断电脑中office的版本


    引用空间

    using Microsoft.Win32;
    using System.IO;


            public bool ExistsRegedit()
            {
                bool ifused = false;
                RegistryKey rk = Registry.LocalMachine;
                RegistryKey akey = rk.OpenSubKey(@"SOFTWARE\\Microsoft\\Office\\11.0\\Word\\InstallRoot\\");
                RegistryKey akeytwo = rk.OpenSubKey(@"SOFTWARE\\Microsoft\\Office\\12.0\\Word\\InstallRoot\\");
                //检查本机是否安装Office2003
                if (akey != null)
                {
                    string file03 = akey.GetValue("Path").ToString();
                    if (File.Exists(file03 + "Excel.exe"))
                    {
                        ifused = true;
                    }
                }
                //检查本机是否安装Office2007
                if (akeytwo != null)
                {
                    string file07 = akeytwo.GetValue("Path").ToString();
                    if (File.Exists(file07 + "Excel.exe"))
                    {
                        ifused = true;
                    }
                }
                return ifused;
            }

    转 

  • 相关阅读:
    jvm类加载机制
    线程误区-join,wait(里边还是调用的wait)
    线程间通信wait和notify【All】简介
    指令重排序
    window.opener
    scrollIntoView()
    保持饥饿,保持愚蠢
    执行sql语句,不依靠实体 获取string值
    join函数详解
    html常用代码大全
  • 原文地址:https://www.cnblogs.com/likeyou/p/2847330.html
Copyright © 2020-2023  润新知