private void frmEncrypt_OnFinished() { Logger.Info("--加密完成--"); Invoke(new Action(() => { btnEncrypt.Enabled = true; btnCancle.Enabled = false; panel1.Enabled = true; PopWindow.Information("视频加密完成!", "系统提示", this); if (chkDelete.Checked) { string msg = string.Format("是否要删除【{0}】?", Path.GetFileName(txtFileName.Text)); if (PopWindow.Question(msg, "系统提示", this) == DialogResult.Yes) { try { File.Delete(txtFileName.Text); } catch { } } } if (OnNewVideo != null) { OnNewVideo(txtFileName.Text, TargetFile); } })); }
private void btnCancle_Click(object sender, EventArgs e) { if (PopWindow.Question("你确定要取消转码吗?") == DialogResult.Yes) { btnCancle.Enabled = false; convert.Stop(); } }
private void btnCancle_Click(object sender, EventArgs e) { if (PopWindow.Question("你确定要取消加密吗?") == DialogResult.Yes) { btnCancle.Enabled = false; IsStopped = true; } }
//----------------------------------------------------------------------------------------------------- private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { if (PopWindow.Question("你确定要退出程序吗?") == DialogResult.Yes) { if (frmLog != null) { frmLog.Close(); } LogManager.Instance.Close(); StopServer(); } else { e.Cancel = true; } }
//----------------------------------------------------------------------------------------------------- private void mDelete_Click(object sender, EventArgs e) { if (thumbPanel.SelectedItem != null) { string file = thumbPanel.SelectedItem.Tag.ToString(); string msg = string.Format("你确定要删除【{0}】吗?", Path.GetFileName(file)); if (PopWindow.Question(msg) == DialogResult.Yes) { thumbPanel.Items.Remove(thumbPanel.SelectedItem); try { File.Delete(file); File.Delete(GetThunbPath(file)); } catch { } LoadVideo(); } } }
private void btnEncrypt_Click(object sender, EventArgs e) { if (txtFileName.TextLength == 0) { txtFileName.Focus(); return; } if (txtPassword.TextLength == 0) { if (PopWindow.Question("你没有设置视频查看密码,是否继续?") == DialogResult.No) { return; } } if (!File.Exists(txtFileName.Text)) { PopWindow.Warnning("文件不存在!"); return; } password = new PasswordManegment(txtPassword.Text).Password; Category = cmbCategory.Text; btnEncrypt.Enabled = false; panel1.Enabled = false; btnCancle.Enabled = true; string filename = txtFileName.Text; TargetFile = frmMain.VideoDir + cmbCategory.Text + "\\" + Path.GetFileName(filename); if (!Directory.Exists(frmMain.VideoDir + cmbCategory.Text)) { Directory.CreateDirectory(frmMain.VideoDir + cmbCategory.Text); } Logger.Info("--开始加密--"); Logger.Info("{0}->{1}", txtFileName.Text, TargetFile); Encrypt(password, filename, TargetFile); }