private void btnBrowse_Click(object sender, EventArgs e) { // Show the dialog and get result. OpenFileDialog openFileDialog1 = new OpenFileDialog(); DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { tbMp4Path.Text = openFileDialog1.FileName; Regex re = new Regex("\\d*" + ConfigUtil.MP4); Match m = re.Match(tbMp4Path.Text); if (m.Success) { string videoInfo = VideoUtil.getVideoInfo(tbMp4Path.Text); ConfigUtil.FFMPEG_SCALE = VideoUtil.getWidth(videoInfo); rdBtnScaleWidth.Text = ConfigUtil.FFMPEG_SCALE + ""; btnConvert.Enabled = true; } else { tbMp4Path.Text = ""; btnConvert.Enabled = false; MessageBox.Show("Can't Support File " + openFileDialog1.FileName); } } }