//----------------------------------------------------------------------------------------------------- private void mDecrypt_Click(object sender, EventArgs e) { if (selectPic == null) { return; } string file = selectPic.Tag.ToString(); if (!File.Exists(file)) { return; } string dir = Path.GetDirectoryName(file); string category = dir.Substring(dir.LastIndexOf("\\") + 1); frmPassword frm = new frmPassword(category, file); if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsPasswordValid) { // 视频解密 } else { PopWindow.Warnning("密码不正确,请重新输入!"); } } }
//----------------------------------------------------------------------------------------------------- private void thumbPanel_OnItemDoubleClick(object sender, EventArgs e) { PictureListItem item = (PictureListItem)sender; string file = item.Tag.ToString(); if (!File.Exists(file)) { return; } string dir = Path.GetDirectoryName(file); string category = dir.Substring(dir.LastIndexOf("\\") + 1); frmPassword frm = new frmPassword(category, file); if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsPasswordValid) { PlayVideo(category, Path.GetFileName(file), frm.Password); } else { PopWindow.Warnning("密码不正确,请重新输入!"); } } }
private void frmConvert_FormClosing(object sender, FormClosingEventArgs e) { if (IsRunning) { e.Cancel = true; PopWindow.Warnning("正在转码,请稍后 。。。"); } }
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); }