Пример #1
0
        public void WriteSettings()
        {
            try
            {
                IniFile ini = new IniFile(TargetFile);
                ini.IniWriteValue("config", "Volume", Volume.ToString());
                ini.IniWriteValue("config", "HadithNoLastOpen", HadithNoLastOpen.ToString());
                ini.IniWriteValue("config", "ChapterLastOpen", ChapterLastOpen.ToString());
                ini.IniWriteValue("config", "PageLastOpen", PageLastOpen.ToString());
                ini.IniWriteValue("config", "LanguageLastOpen", LanguageLastOpen.ToString());
                ini.IniWriteValue("config", "HadithLastOpen", HadithLastOpen.ToString());
                ini.IniWriteValue("config", "UrlRecitation", UrlRecitation);

                ini.IniWriteValue("config", "VerseSize", VerseSize.ToString());
                //ini.IniWriteValue("config", "ClickMode", ClickMode.ToString());
                //ini.IniWriteValue("config", "PlayMode", PlayMode.ToString());
               
                ini.IniWriteValue("config", "isAutoSpeech", isAutoSpeech.ToString());
                ini.IniWriteValue("config", "isVoiceEnable", isVoiceEnable.ToString());
                ini.IniWriteValue("config", "isGestureEnable", isGestureEnable.ToString());
                ini.IniWriteValue("config", "isAutoShutdownEnable", isAutoShutdownEnable.ToString());
                ini.IniWriteValue("config", "ShutdownTime", ShutdownTime.ToString());

            }
            catch
            {
                throw;
            }
        }
Пример #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            String FO4Prefs = (FO4DocFolder + @"\Fallout4Prefs.ini");
            String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");
            setReadOff();

            IniFile ini = new IniFile(FO4Prefs);
            ini.IniWriteValue("Launcher", "bEnableFileSelection", "1");
            IniFile ini2 = new IniFile(FO4Custom);
            ini.IniWriteValue("Archive", "bInvalidateOlderFiles", "1");
            ini.IniWriteValue("Archive", "sResourceDataDirsFinal", " ");
            setReadON();

        }
Пример #3
0
        public static void LogFileSecurityUpdate( IniFile ini, int matchId, string szLogFilePath)
        {
            for(int j = 0; j < MAX_LOGS; ++j) {

                string szLogFile = ini.IniReadValue("logs", "log" + j);

                if(szLogFile.Length == 0) {
                    ini.IniWriteValue("logs", "log" + j, szLogFilePath);
                    break;
                }

                if(szLogFile.Equals(szLogFilePath)) {
                    break;
                }

                if(!File.Exists(szLogFile)) {
                    ini.IniWriteValue("logs", "log" + j, "");
                }
            }
        }
Пример #4
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");

            IniFile ini = new IniFile(FO4Custom);
            setReadOff();
            ini.IniWriteValue("Display", "fPipboyScreenEmitIntensityPA", "1.0000");
            ini.IniWriteValue("Display", "fPipboyScreenEmitIntensity", "1.2500");
            ini.IniWriteValue("Pipboy", "bPipboyDisableFX", "1");
            setReadON();
            System.Windows.Forms.MessageBox.Show("PipBoy Fx Disabled. Intensitys set to PA:1.0000 PB:1.2500");
        }
Пример #5
0
 private void button7_Click(object sender, EventArgs e)
 {
     String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");
     setReadOff();
     IniFile ini = new IniFile(FO4Custom);
     ini.IniWriteValue("Display", "fDefaultWorldFOV", textBox4.Text);
     String FO4Prefs = (FO4DocFolder + @"\Fallout4Prefs.ini");
     IniFile ini2 = new IniFile(FO4Prefs);
     ini2.IniWriteValue("Display", "fDefaultWorldFOV", textBox4.Text);
     setReadON();
     System.Windows.Forms.MessageBox.Show("Set 3rd Person FOV to " + textBox4.Text);
 }
Пример #6
0
 private void button5_Click_1(object sender, EventArgs e)
 {
     String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");
     setReadOff();
     IniFile ini = new IniFile(FO4Custom);
     ini.IniWriteValue("General", "sIntroSequence", "0");
     ini.IniWriteValue("General", "fChancesToPlayAlternateIntro", "0");
     ini.IniWriteValue("General", "uMainMenuDelayBeforeAllowSkip", "0");
     setReadON();
     System.Windows.Forms.MessageBox.Show("Intro sequence disabled.");
 }
Пример #7
0
 private void button4_Click(object sender, EventArgs e)
 {
     String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");
     setReadOff();
     IniFile ini = new IniFile(FO4Custom);
     ini.IniWriteValue("gameplay", "fPlayerDisableSprintingLoadingCellDistance", "0");
     setReadON();
     System.Windows.Forms.MessageBox.Show("Cell reset Run Bug fix applied.");
 }
 public void DelExclusion(string path)
 {
     IniFile ins = new IniFile(loc);
     string t = string.Empty;
     int total = 0;
     try
     {
         t = ins.IniReadValue("Total_Exclusion", "Value");
     }
     catch { }
     if (t.Trim().Length > 0)
     {
         total = Convert.ToInt32(t);
         for(int i=1;i<=total;i++)
         {
             t = ins.IniReadValue("Exclusion", i.ToString());
             if(t==path)
             {
                 ins.IniWriteValue("Exclusion", i.ToString(), path + "netsky.removed.exclusion");
                 exclusions.Remove(path);
             }
         }
     }
 }
 public void AddExclusion(string path)
 {
     IniFile ins = new IniFile(loc);
     int index = 0;
     string t = string.Empty;
     try
     {
         t = ins.IniReadValue("Total_Exclusion", "Value");
     }
     catch { }
     if (t.Trim().Length > 0)
     {
         index = Convert.ToInt32(t);
         index++;
     }
     else
         index++;
     exclusions.Add(path);
     ins.IniWriteValue("Exclusion", index.ToString(), path);
     ins.IniWriteValue("Total_Exclusion", "Value", index.ToString());
 }
        public MainWindow()
        {
            folder_helper.check_folder(install_path);
            Load_ini.make_INI(Setting_path[0]);

            InitializeComponent();

            IniFile ini = new IniFile(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\[ACID]Cache Cleaner\\Settings\\Settings.ini"));
            ini.IniWriteValue("Update", "Last_Update", DateTime.Now.ToString());
            if (!Online_Helper.IsConnectedToInternet())
            {
                use_img = false;
            }
            this.checkBox3.IsChecked = Load_ini.Get_INI_Bool("Cache", "Auto_Cache");
            /*IniFile ini = new IniFile(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\[ACID]Cache Cleaner\\Settings\\Settings.ini"));
            MessageBox.Show(ini.IniReadValue("Load", "Auto_Kill"));*/
            textBox1.Text = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)) + "\\IMVUClient\\";
            if (Load_ini.Get_INI_Bool("Load", "Auto_Del"))
            {
                this.checkBox1.IsChecked = true;
                this.checkBox2.IsChecked = true;
                this.checkBox2.IsEnabled = false;
                this.Cleaner_Start.Content = "Clean Folders";
                clean = 1;
            }
            if (Load_ini.Get_INI_Bool("Load", "Auto_Kill") || checkBox2.IsChecked == true)
            {
                checkBox2.IsChecked = true;
                IMVU_Helper.kill_IMVU("IMVUClient");
                button1.Visibility = Visibility.Hidden;
                runner.Start();
            }else if (IMVU_Helper.IsProcessOpen("IMVUClient"))
            {
                //Cleaner_Start.IsEnabled = false;
                if (!Load_ini.Get_INI_Bool("Load", "Auto_Kill") && !Load_ini.Get_INI_Bool("Load", "Auto_Del"))
                {
                    Cleaner_Start.IsEnabled = true;
                }
                else
                {
                    Cleaner_Start.IsEnabled = false;
                }
            }
            else
            {
                button1.Visibility = Visibility.Hidden;
            }
        }
Пример #11
0
        // NOTE: this function does not get called on some PCs (QWERTs), for most things, don't rely on this function!!!!
        public static void onMatchStarted(int matchId, string matchMediaPath)
        {
            try {

                // Set current matchId, and match media path to our equivalent global variables.
                g_iMatchId = matchId;
                g_szMatchMediaPath = matchMediaPath;

                // Check the match media path for any files there might already be in there, and print them in our log.
                string[] f = Directory.GetFiles(g_szMatchMediaPath);

                if(f.Length > 0) {
                    Log.WriteLog("Match Media Path files: ");
                    foreach(string ff in f) {
                        Log.WriteLog(ff);
                    }
                }

                // When players do an incorrect logout from ESL Wire, This code will make it so
                // if they do 5 incorrect log outs in a row, and do 1 correct logout after that
                // then all 6 logs will be uploaded - this file keeps track of all the created logs
               			// incase of an incorrect logout, plugin crash, or Wire crash.
               			// {
                    int i = 0;
                    IniFile ini = new IniFile(System.IO.Path.GetTempPath() + matchId + ".txt");
                    string str = ini.IniReadValue("misc", "logfilenum");

                    if(str.Length > 0) {
                        i = int.Parse(str)+1;
                    } else {
                        i = 1;
                    }

                    ini.IniWriteValue("misc", "logfilenum", i.ToString());

                    Log.LogFileSecurityMove(ini, matchId);
                    Log.LogFileSecurityUpdate(ini, matchId, g_szLogFilePath);
                //}

                // Get the ESL Wire profile of the user, and print it in the log.
                Dictionary<string, object> d = new Dictionary<string, object>();
                Wire.SessionInterface si = Wire.InterfaceFactory.sessionInterface();

                d = si.user();

                string prof = "Unknown";
                foreach (KeyValuePair<string, object> pair in d) {
                    if(pair.Key.Equals("profileURL")) {
                        prof = (string)pair.Value;
                    }
                }

                Log.WriteLog("    -> SA-MP AC Extension Plugin v" + g_dVersion.ToString() + " for use in ESL loaded.");
                Log.WriteLog("	-> Number of log files: " + i);
                Log.WriteLog("	-> ESL Profile: " + prof);
                Log.WriteLog("Match ID: " + matchId);
            } catch(Exception e) {
                Log.WriteLog(e.ToString());
            }
        }
 private void button2_Click(object sender, RoutedEventArgs e)
 {
     IniFile ini = new IniFile(Setting_path[0]);
     ini.IniWriteValue("Load", "Auto_Del", checkBox1.IsChecked.Value.ToString());
     ini.IniWriteValue("Load", "Auto_Kill", checkBox2.IsChecked.Value.ToString());
     ini.IniWriteValue("Cache", "Auto_Cache", checkBox3.IsChecked.Value.ToString());
     ini.IniWriteValue("Auto", "Auto_Clean_Timeout", textBox2.Text);
 }
Пример #13
0
 private void UpdateReviewINI(IniFile F)
 {
     F.IniWriteValue("Review", "Complete", PercentCompletion);
     if (!Reviewing)
     {
         F.IniWriteValue("Review", "LastReviewed", LastReview.ToLongDateString());
     }
     else
     {
         F.IniWriteValue("Review", "LastReviewed", DateTime.Now.ToLongDateString());
     }
     F.IniWriteValue("Review", "LastOpen", DateTime.Now.ToLongDateString());
     F.IniWriteValue("Review", "Reviewer", Reviewer);
     F.IniWriteValue("Review", "Notes", ReviewNotes);
 }
 public void AddHistory(string file, string vir_name)
 {
     IniFile ins = new IniFile(loc);
     int index = 0;
     string t = string.Empty;
     try
     {
         t = ins.IniReadValue("Total_History", "Value");
     }
     catch { }
     if (t.Trim().Length > 0)
     {
         index = Convert.ToInt32(t);
         index++;
     }
     else
         index++;
     string val = file + "#GAP#" + vir_name;
     file_names.Add(file);
     this.vir_name.Add(vir_name);
     ins.IniWriteValue("History", index.ToString(), val);
     ins.IniWriteValue("Total_History", "Value", index.ToString());
 }
Пример #15
0
        private void button3_Click(object sender, EventArgs e)
        {
            String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");

            IniFile ini = new IniFile(FO4Custom);
            setReadOff();
            ini.IniWriteValue("Display", "fPipboyScreenEmitIntensityPA", textBox1.Text);
            ini.IniWriteValue("Display", "fPipboyScreenEmitIntensity", textBox2.Text);
            ini.IniWriteValue("Pipboy", "bPipboyDisableFX", "1");
            setReadON();
            System.Windows.Forms.MessageBox.Show("Intensitys set to PA:"+ textBox1.Text + " PB:" + textBox2.Text);
        }
Пример #16
0
 /// <summary>
 /// Construtor da classe
 /// </summary>
 public RelatorioFiscal()
     : base()
 {
     IniFile iniFile = new IniFile(System.IO.Directory.GetCurrentDirectory() + "\\BemaFI32.ini");
     iniFile.IniWriteValue("Sistema", "Path", "C:\\");
 }
Пример #17
0
        public frmUNIcastStreamer()
        {
            InitializeComponent();

            // Clear sample texts
            lblSubject.Text = String.Empty;
            lblLecturer.Text = String.Empty;
            lblDate.Text = String.Empty;

            // Fix screen position bug
            this.StartPosition = FormStartPosition.CenterScreen;

            // Load settings
            IniFile ini = new IniFile(Path.Combine(Environment.CurrentDirectory, IniFile));
            string str = ini.IniReadValue(Section, KeyStream);
            if (!Address.TryParse(str, out streamAddress))
            {
                streamAddress = DefaultStreamAddress;
                ini.IniWriteValue(Section, KeyStream, streamAddress.ToString());
            }
            str = ini.IniReadValue(Section, KeyMessage);
            if (!Address.TryParse(str, out messageAddress))
            {
                messageAddress = DefaultMessageAddress;
                ini.IniWriteValue(Section, KeyMessage, messageAddress.ToString());
            }

            // Load DeckLink API
            Thread deckLinkStreamerThread = new Thread(() =>
            {
                deckLinkStreamer = new DeckLinkStreamer();

                // Set callback
                deckLinkStreamer.SetCallback(this);

                // Initialise API
                if (!deckLinkStreamer.TryInitializeAPI())
                {
                    deckLinkStreamer.SetCallback(null);
                    MessageBox.Show(strings.errorDeckLinkDriver, strings.error);
                    Environment.Exit(1);
                }

                deckLinkAPIVersion = deckLinkStreamer.DeckLinkAPIVersion;
                lblDeckLinkVersion.InvokeIfRequired(c => c.Text = deckLinkAPIVersion);
            });
            deckLinkStreamerThread.SetApartmentState(ApartmentState.MTA);
            deckLinkStreamerThread.IsBackground = true;
            deckLinkStreamerThread.Start();

            // Initialise variables, load settings
            duration = new TimeSpan(1, 30, 00);
            timeMode = 0;
            timer = new System.Windows.Forms.Timer();
            timer.Tick += timer_Tick;

            tabControl.SelectedIndex = 0;

            progressRing.ProgressPercentage = 0;

            isStreaming = false;

            streamServer = new MulticastServer(streamAddress.IP, streamAddress.Port, TTL);
            messageServer = new MulticastServer(messageAddress.IP, messageAddress.Port, TTL);
            Thread inputMonitorThread = new Thread(() =>
            {
                inputMonitor = new InputMonitor();
                inputMonitor.InputPositionReceived += inputMonitor_InputPositionReceived;
                inputMonitor.Start();
            });
            inputMonitorThread.IsBackground = true;
            inputMonitorThread.Start();

            ffmpeg = new FFmpeg();
            if (ffmpeg.isAvailable)
            {
                //ffmpeg.OnLogDataReceived += ffmpeg_LogDataReceived;
                ffmpegVersion = ffmpeg.GetVersion();
                lblFFmpegVersion.Text = ffmpegVersion;
            }

            pipeHandler = new PipeHandler();
            pipeHandler.ClientConnected += pipeHandler_ClientConnected;
            pipeHandler.ClientDisconnected += pipeHandler_ClientDisconnected;
            //else
            //{
            //    MessageBox.Show(strings.errorFFmpeg, strings.error);
            //    Environment.Exit(1);
            //}

            //performanceMonitor = new PerformanceMonitor(new string[] { "ffmpeg", "BMDStreamingServer", Process.GetCurrentProcess().ProcessName });
            //performanceMonitor.PerfValuesReceived += performanceMonitor_PerfValuesReceived;
            //performanceMonitor.StartMonitoring();

            lblVersion.Text += Application.ProductVersion;

            progressRing.Enabled = true;

            messenger = new frmMessenger();
        }
Пример #18
0
 private void button5_Click(object sender, EventArgs e)
 {
     String FO4Custom = (FO4DocFolder + @"\Fallout4Custom.ini");
     setReadOff();
     IniFile ini = new IniFile(FO4Custom);
     ini.IniWriteValue("Display", "bBorderless", "1");
     ini.IniWriteValue("Display", "bFull Screen", "0");
     ini.IniWriteValue("Display", "bTopMostWindow", "0");
     ini.IniWriteValue("Display", "bMaximizeWindow", "0");
     setReadON();
     System.Windows.Forms.MessageBox.Show("Set Borderless fullscreen");
 }
Пример #19
0
        /// <summary>
        /// Copies to dropbox.
        /// </summary>
        /// <param name="__args">Arguments</param>
        private int copyToDropbox(string[] __args)
        {
            IniFile __ini;
            FileInfo __inifi;
            bool __isdir;
            string __path;
            FileInfo __selectedfile = null;
            string __selectedfilename = null;
            string __selectedfileext = null;
            int __count = 0;

            if (Directory.Exists(__args[1 +__form.idx]))
            {
                __isdir = true;
                __path = __args[1 +__form.idx];
            }
            else
            {
                __isdir = false;
                __path = new FileInfo(__args[2]).DirectoryName;
                __selectedfile = new FileInfo(__args[2]);
                __selectedfilename = __selectedfile.Name;
                __selectedfileext = __selectedfile.Extension;
            }

            if (File.Exists(__path + "\\.dbx") || File.Exists(__path + "\\+ Screens\\.dbx"))
            {
                __ini = new IniFile(__path + "\\.dbx");
                string __conf = __ini.IniReadValue("Dropbox", System.Environment.UserName);
                if (__conf == "")
                {
                    __ini = new IniFile(__path + "\\+ Screens\\.dbx");
                    __conf = __ini.IniReadValue("Dropbox", System.Environment.UserName);
                    __inifi = new FileInfo(__path + "\\+ Screens\\.dbx");
                }
                else
                {
                    __inifi = new FileInfo(__path + "\\.dbx");
                }
                __inifi.Attributes = FileAttributes.Hidden;

                string[] extensions = { ".jpg", ".png", ".gif" };
                if (__conf != "")
                {
                    if (Directory.Exists(__conf))
                    {
                        if (__isdir) // IF DIRECTORY
                        {
                            string[] __files;
                            __files = Directory.GetFiles(__conf, "*.*", SearchOption.TopDirectoryOnly).Where(f => extensions.Contains(new FileInfo(f).Extension.ToLower())).ToArray();
                            foreach (string __file in __files)
                            {
                                try
                                {
                                    File.Delete(__file);
                                }
                                catch//(Exception __e)
                                {
                                    //MessageBox.Show(__e.Message);
                                }
                            }

                            __files = Directory.GetFiles(__path, "*.*", SearchOption.TopDirectoryOnly).Where(f => extensions.Contains(new FileInfo(f).Extension.ToLower())).ToArray();

                            foreach (string __file in __files)
                            {
                                __count++;
                                FileInfo __fi = new FileInfo(__file);

                                try
                                {
                                    __fi.CopyTo(__conf + "\\" + __fi.Name, true);
                                }
                                catch(Exception __e)
                                {
                                    MessageBox.Show(__e.Message);
                                }
                            }
                        }
                        else // IF FILE
                        {
                            //MessageBox.Show(__selectedfileext);
                            if (__selectedfileext.ToLower() == ".psd") //IF PSD FILE
                            {
                                string __tempname = __selectedfilename.Substring(0, __selectedfilename.Length - __selectedfileext.Length);
                                string[] __files = Directory.GetFiles(__path + "/+ Screens", __tempname + "*.*", SearchOption.TopDirectoryOnly).Where(f => extensions.Contains(new FileInfo(f).Extension.ToLower())).ToArray();

                                foreach (string __file in __files)
                                {
                                    __count++;
                                    FileInfo __fi = new FileInfo(__file);
                                    try
                                    {
                                        __fi.CopyTo(__conf + "\\" + __fi.Name, true);
                                    }
                                    catch (Exception __e)
                                    {
                                        MessageBox.Show(__e.Message);
                                    }
                                }
                            }
                            else if (__selectedfileext.ToLower() == ".jpg" || __selectedfileext.ToLower() == ".png") //IF JPEG/PNG FILE
                            {
                                __count++;
                                __selectedfile.CopyTo(__conf + "\\" + __selectedfilename, true);
                            }
                        }
                    }
                    else
                    {
                        goto config;
                    }
                }
                else
                {
                    goto config;
                }
            }
            else
            {
                goto config;
            }

            goto stop;

            config:
            string __prompt = Prompt.ShowDialog("Path to your Dropbox directory", "Configuration");
            if (__prompt != "")
            {
                __ini = new IniFile(__path + "\\.dbx");
                __ini.IniWriteValue("Dropbox", System.Environment.UserName, __prompt);
                __inifi = new FileInfo(__path + "\\.dbx");
                __inifi.Attributes = FileAttributes.Hidden;
                return copyToDropbox(__args);
            }
            stop:
            {
                return __count;
            }
        }
Пример #20
0
        private void CompThread()
        {
            Process Recomp;
            FileInfo FI;
            bool ResetFailCount = false;
            string Command;
            bool fail = false;
            string[] IniFiles;
            int failcount = 0;
            st = new Stopwatch();
            string[] AVIFiles;
            string BaseName;
            string CurPath;
            this.Invoke((MethodInvoker)delegate { this.Text = "Compression Manager - Running"; });
            for (int j = CurrentDir; j < FileList.Items.Count; j++)
            {
                CurPath = FileList.Items[j].ToString();
                AVIFiles = Directory.GetFiles(CurPath, "2*.avi");
                FileList.Invoke((MethodInvoker)delegate { FileList.SelectedIndex = j; });
                TotProgress.Invoke((MethodInvoker)delegate { TotProgress.Maximum = 100; });
                TotProgress.Invoke((MethodInvoker)delegate { TotProgress.Value = CurrentFile; });
                BaseName = AVIFiles[0].Substring(CurPath.Length + 1, 15);
                for (int i = CurrentFile; i < AVIFiles.Length; i++)
                {
                    FI = new FileInfo(AVIFiles[i]);
                    CurrentFile = i;
                    UpdateINI();
                    Command = "-i " + AVIFiles[i] + " -y -vcodec libx264 -crf 28 -coder 0 -an ";
                    Command += CurPath + "\\temp.avi";
                    CurFileProg.Invoke((MethodInvoker)delegate { CurFileProg.Value = 0; });
                    CurrentLabel.Invoke((MethodInvoker)delegate { CurrentLabel.Text = "Current File: " + AVIFiles[i]; });
                    TotalLabel.Invoke((MethodInvoker)delegate { TotalLabel.Text = "Total Progress: " + (i + 1).ToString() + " of " + AVIFiles.Length.ToString(); });
                    Recomp = new Process();
                    Recomp.StartInfo = new ProcessStartInfo("C:\\x264\\ffmpeg.exe", Command);
                    Recomp.StartInfo.CreateNoWindow = true;
                    Recomp.StartInfo.UseShellExecute = false;
                    Recomp.StartInfo.RedirectStandardOutput = true;
                    Recomp.StartInfo.RedirectStandardError = true;
                    Recomp.ErrorDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);
                    Recomp.OutputDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);
                    Recomp.Start();
                    Recomp.BeginOutputReadLine();
                    Recomp.BeginErrorReadLine();
                    st.Start();
                    while (!Recomp.WaitForExit(1000))
                    {
                        if (!Run)
                        {
                            //Need to stop compression
                            Recomp.Kill();
                            Recomp.WaitForExit();
                            fail = true; //This shouldn't be needed... but...
                            this.Invoke((MethodInvoker)delegate { this.Text = "Compression Manager - Stopped"; });
                            return; //This should hopefully kill the thread.
                        }
                        if (st.ElapsedMilliseconds > 300000)
                        {

                            if (!ResetFailCount)
                            {
                                Recomp.Kill();
                                Recomp.WaitForExit();
                                ResetFailCount = true;
                                i--;
                                fail = true;
                            }
                            else
                            {
                                Recomp.Kill();
                                Recomp.WaitForExit();
                                fail = true;
                                failcount++;
                                FailCountLbl.Invoke((MethodInvoker)delegate { FailCountLbl.Text = "Fail Count: " + failcount.ToString(); });
                                TotProgress.Invoke((MethodInvoker)delegate { TotProgress.Increment(1); });
                                ResetFailCount = false;
                            }
                        }
                    }
                    if ((File.Exists(CurPath + "\\temp.avi")) & !fail)
                    {
                        File.Delete(AVIFiles[i]);
                        File.Move(CurPath + "\\temp.avi", AVIFiles[i]);
                        TotProgress.Invoke((MethodInvoker)delegate { TotProgress.Increment(1); });
                        ResetFailCount = false;
                    }
                    fail = false;
                }
                IniFiles = Directory.GetFiles(CurPath, "*_Settings.txt");
                BioINI = new IniFile(IniFiles[0]);
                BioINI.IniWriteValue("Review", "Compressed", true);
                StatusBox.Invoke((MethodInvoker)delegate { StatusBox.Items[j] = "Compressed"; });
                CurrentFile = 0;
                CurrentDir++;
                UpdateINI();
            }
            this.Invoke((MethodInvoker)delegate { this.Text = "Compression Manager - Finished"; });
        }