public static TVClass renameFile(string fileName) { TVClass tvShow = new TVClass(fileName); Regex _regex = new Regex(fov); Match match = _regex.Match(fileName); if (match.Success) { tvShow.ShowName = match.Groups[1].Value; } return(tvShow); }
private void button3_Click(object sender, EventArgs e) { openFileDialog1.Title = "Select Media files"; openFileDialog1.Filter = "Video Files (*.avi;*.mkv;*.mp4;*.m4v;*.mpg;*.mov;*.mpeg;*.rm;*.rmvb;*.wmv;*.webm)|*.avi;*.mkv;*.mp4;*.m4v;*.mpg;*.mov;*.mpeg;*.rm;*.rmvb;*.wmv;*.webm|Archive Files (*.zip;*.rar;*.r01;*.7z;)|*.zip;*.rar;*.r01;*.7z;|All Files (*.*)|*.*"; openFileDialog1.FileName = ""; openFileDialog1.FilterIndex = 1; openFileDialog1.CheckFileExists = true; openFileDialog1.CheckPathExists = true; if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TVClass newShow = TVRenamer.renameFile(openFileDialog1.SafeFileName); //openFileDialog1.FileName; } //end of if //MessageBox.Show(System.AppDomain.CurrentDomain.FriendlyName); //MessageBox.Show(System.Reflection.Assembly.GetEntryAssembly().Location); }