private void btnExecuteExtract_Click(object sender, EventArgs e) { btnExecuteExtract.Enabled = false; string strtmp = btnExecuteExtract.Text; btnExecuteExtract.Text = "Extracting..."; Application.DoEvents(); try { zzz.In = new List <string> { Path.GetFullPath(txtZZZ_in.Text.Trim()) }; zzz.Path_ = lblZZZ_out.Text; openfolder(zzz.Extract()); } catch (Exception err) { Logger.WriteLine(err.Message); Logger.WriteLine(txtZZZ_in.Text.Trim()); MessageBox.Show(err.Message, "Exception"); } btnExecuteExtract.Text = strtmp; btnExecuteExtract.Enabled = true; }
private static string ExtractMenu() { StartExtractMenu: string path; bool good; const string title = "\n Extract zzz Screen\n"; do { good = false; Logger.Write( title + "Enter the path to zzz file: "); path = Console.ReadLine(); if (path != null) { path = path.Trim('"'); path = path.Trim(); Logger.WriteLine(); path = GetFullPath(path); good = File.Exists(path); } if (!good) { Logger.WriteLine("File doesn't exist\n"); } else { break; } }while (true); ZZZ.In = new List <string> { path }; do { good = false; Logger.Write( title + "Enter the path to extract contents: "); path = Console.ReadLine(); if (path != null) { path = path.Trim('"'); path = path.Trim(); path = GetFullPath(path); Logger.WriteLine(); Directory.CreateDirectory(path); good = Directory.Exists(path); } if (!good) { Logger.WriteLine("Directory doesn't exist\n"); } else { break; } }while (true); ZZZ.Path = path; try { return(ZZZ.Extract()); } catch (PathTooLongException) { goto StartExtractMenu; } catch (InvalidDataException) { goto StartExtractMenu; } }