示例#1
0
        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            string name = openFileDialog1.FileName;

            try
            {
                CryptoKeyManager.CreateFromFile(name);
            }
            catch (Exception ex)
            {
                MessageBox.Show(
                    "The file you provided is not a correct key. Please make sure you select the license key given when you registered",
                    "Error during scan",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            _worker = new EncryptWorker(name);
            _worker.ProgressChanged += _worker_ProgressChanged;
            _worker.RunWorkerCompleted += _worker_RunWorkerCompleted;

            panel1.Location = GuidBox.Location;
            panel1.Visible = true;
            GuidBox.Visible = false;
            decryptButton.Enabled = false;
            button1.Enabled = false;

            _worker.RunWorkerAsync();
        }
示例#2
0
        public GroupBoxScan()
        {
            InitializeComponent();

            if (CryptoKeyManager.guid != Guid.Empty)
                ShowSeForm();
            else
            {
                VisibleChanged += OnVisibleChanged;
            }

            worker = new EncryptWorker();
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.ProgressChanged += worker_ProgressChanged;
        }