Example #1
0
        private J_JobManage()
        {
            //读取设置初始化服务器
            Console.WriteLine("Read setting file");
            if (File.Exists(Directory.GetCurrentDirectory() + @"/workerSetting.txt"))
            {
                string readSetting = File.ReadAllText(Directory.GetCurrentDirectory() + @"/workerSetting.txt");
                worker.readServerSetting(readSetting);
            }
            else
            {
                worker.saveServerSetting(Directory.GetCurrentDirectory() + @"/workerSetting.txt", "text");
            }
            //软件设置
            if (File.Exists(Directory.GetCurrentDirectory() + @"/softWareSetting.txt"))
            {
                string readSetting = File.ReadAllText(Directory.GetCurrentDirectory() + @"/softWareSetting.txt");

                try
                {
                    softWares = JsonConvert.DeserializeObject <J_SoftWareSetting>(readSetting);
                }
                catch
                {
                    Console.WriteLine("read soft settings error!");
                }
            }
            else
            {
                softWares = J_CreateSoftwareSettings();
                softWares.softList.Add(new J_softWareData("ffmpeg", "c:/ffmpeg.exe", "2018"));
                softWares.saveSettings(Directory.GetCurrentDirectory() + @"/softWareSetting.txt");
            }
        }
Example #2
0
        J_SoftWareSetting J_CreateSoftwareSettings()
        {
            J_SoftWareSetting softWares = new J_SoftWareSetting();
            RegistryKey       keyX      = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)
                                          .OpenSubKey("SOFTWARE\\Autodesk\\Maya");

            string[] mayaVersionKeys = keyX.GetSubKeyNames();

            foreach (var item in mayaVersionKeys)
            {
                string      mayaRegistryPath = (item + "\\Setup\\InstallPath");
                RegistryKey mayaPathKey      = keyX.OpenSubKey(mayaRegistryPath);
                if (mayaPathKey != null)
                {
                    softWares.softList.Add(
                        new J_softWareData("maya", (mayaPathKey.GetValue("MAYA_INSTALL_LOCATION").ToString() + "bin\\maya.exe"), item));
                    softWares.softList.Add(
                        new J_softWareData("mayabatch", (mayaPathKey.GetValue("MAYA_INSTALL_LOCATION").ToString() + "bin\\mayabatch.exe"), item));
                }
            }

            return(softWares);
        }
Example #3
0
 public void openSettings(string settings)
 {
     J_SoftWareSetting temp = JsonConvert.DeserializeObject <J_SoftWareSetting>(settings);
 }