예제 #1
0
        private void SelectFile_button_Click(object sender, EventArgs e)
        {
            using (var fileDialog = new OpenFileDialog())
            {
                fileDialog.InitialDirectory = "";
                fileDialog.Filter           = "All files (*.*)|*.*";
                fileDialog.FilterIndex      = 0;
                fileDialog.RestoreDirectory = true;

                if (fileDialog.ShowDialog() == DialogResult.OK)
                {
                    if (_filePath != fileDialog.FileName)
                    {
                        //Get the path of specified file
                        _filePath           = fileDialog.FileName;
                        fileName_label.Text = Path.GetFileName(_filePath);

                        //check if its a secure file
                        if (SecureFile.IsSecureFile(_filePath))
                        {
                            mode_comboBox.SelectedItem = mode_comboBox.Items[1];
                            _isSecureFile = true;
                        }
                        else
                        {
                            mode_comboBox.SelectedItem = mode_comboBox.Items[0];
                        }

                        LogMessage(CreateFileInfo(_filePath));
                        key_textBox.Enabled = true;
                    }
                }
            }

            CheckKey();
        }