Exemple #1
0
        //Кнопка - Спрятать.
        private void buttonProcessHide_Click(object sender, EventArgs e)
        {
            //Если пользователь указал все данные
            if (textBoxMainPath.TextLength > 0 && textBoxHideFiles.TextLength > 0)
            {
                outPath = Path.GetDirectoryName(textBoxMainPath.Text) + "\\" + Path.GetFileNameWithoutExtension(textBoxMainPath.Text) + " (hidder)" + Path.GetExtension(textBoxMainPath.Text);
                //MessageBox.Show(outPath);

                //то инициализируем упаковщик
                Hidder hidder = new Hidder(textBoxMainPath.Text, outPath, textBoxHideFiles.Text);
                if (checkBoxHideWithPassword.Checked)
                {
                    hidder.setPassword(textBoxPasswordToHide.Text);
                }
                //и запускаем его
                hidder.hideFilesAtNewThread(radioButtonHideFolder.Checked);

                //так же запускаем новый (thread)поток, который будет информировать о процессе упаковки
                Thread thrdGetInfo = new Thread(() => threadGetInfoHide(hidder));
                thrdGetInfo.IsBackground = true;
                thrdGetInfo.Start();

                /*if (hidder.hideFiles(radioButtonHideFolder.Checked))
                 * {
                 *  MessageBox.Show("Успешно спрятано в новом файле "+outPath);
                 * } else
                 * {
                 *  MessageBox.Show("Не удалось спрятать!");
                 * }*/
            }
            //MessageBox.Show(((char)65).ToString());
        }