// Handle Event click of Button Get info : to Get information from a video file private void BtnGetInfo_Click(object sender, EventArgs e) { try { ofd.Filter = "Videos Files (*.mp4, *.avi, *.flv, *.wav, *.mpg, *.mpeg, *.mkv) | *.mp4; *.avi; *.flv; *.wav; *.mpg; *.mpeg; *.mkv"; DialogResult result = ofd.ShowDialog(); if (result == DialogResult.OK) { FrmInfo frmInfo = new FrmInfo(); frmInfo.GetValue(run.RunCmd(" -i " + "\"" + ofd.FileName + "\"" + " 2>&1 | findstr .* | findstr /i /v \"version lib built\"", true)); frmInfo.ShowDialog(); ChangeToDefault(); } else { return; } } catch (Exception ex) { MessageBox.Show(ex.Message); ChangeToDefault(); } }
private void Others_DragDrop(object sender, DragEventArgs e) { BtnGetInfo.BackColor = SystemColors.Control; pictureDrag1.Visible = false; string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); FileInfo finfo = new FileInfo(files[0]); string fileExtension = finfo.Extension; switch (fileExtension) { case ".mp4": case ".mov": case ".m4a": case ".3gp": case ".3g2": case ".mj2": FrmInfo frmInfo = new FrmInfo(); frmInfo.GetValue(run.RunCmd(" -i " + "\"" + finfo.FullName + "\"" + " 2>&1 | findstr .* | findstr /i /v \"version lib built\"", true)); frmInfo.ShowDialog(); ChangeToDefault(); break; } }