static void Main(string[] args) { StartApp(); var list = GetListByArgs(args); var engine = new SubEngine(); foreach (var key in list.Keys) { try { var fileContent = engine.LoadSrtFile(key); engine.StripHtml(fileContent); engine.SaveFile(fileContent, list[key]); Console.WriteLine($"HTML tags were removed for {key}"); } catch (Exception ex) { Console.WriteLine($"Convert error for {key}"); Console.WriteLine(ex.Message); } } ExitApp(); }
private void BtnBrowse_Click(object sender, EventArgs e) { DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog. if (result == DialogResult.OK) // Test result. { tbSource.Text = openFileDialog1.FileName; tbTarget.Text = openFileDialog1.FileName.Substring(0, openFileDialog1.FileName.Length - 4) + "_1.srt"; } try { fileContent = engine.LoadSrtFile(tbSource.Text); BindGrid(); } catch (Exception ex) { lblErrmsg.Text = $"Loading error for {tbSource.Text}" + ex.Message; } }