public string CheckPPTCore()
        {
            List <string> officeKeys = Registry2.GetAllSubKey(RegistryEnum.LocalMachine, @"SOFTWARE\\Microsoft\\Office\\").ToList();

            if (officeKeys.Count < 1)
            {
                return(null);
            }

            if (officeKeys.Contains("14.0"))
            {
                return("Microsoft PowerPoint 2010");
            }
            if (officeKeys.Contains("12.0"))
            {
                return("Microsoft PowerPoint 2007");
            }
            if (officeKeys.Contains("11.0"))
            {
                return("Microsoft PowerPoint 2003");
            }
            if (officeKeys.Contains("10.0"))
            {
                return("Microsoft PowerPoint XP");
            }
            if (officeKeys.Contains("9.0"))
            {
                return("Microsoft PowerPoint 2000");
            }
            return(null);
        }
Exemple #2
0
 public Compress()
 {
     if (Registry2.Exists("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths", "WinRAR.exe"))
     {
         string regPath = Registry2.Read("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\WinRAR.exe", "").ToStr();
         if (FileDirectory.FileExists(regPath))
         {
             rarSetupPath = regPath;
         }
     }
     if (!FileDirectory.FileExists(rarSetupPath))
     {
         rarSetupPath = "c:\\Program Files (x86)\\WinRAR\\rar.exe";
         if (!FileDirectory.FileExists(rarSetupPath))
         {
             rarSetupPath = "rar.exe".GetBinFileFullPath();
             if (!FileDirectory.FileExists(rarSetupPath))
             {
                 throw new ArgumentNullException("未找到WinRAR安装程序");
             }
         }
     }
 }