private void Button1_Click(object sender, EventArgs e) { button1.Text = "Выполнение"; bool AllRight = true; DisableWorkTextButton(); try { bool result = true; if (int.Parse(textBox2.Text) > 0) { result = OP.Crawl(textBox1.Text, int.Parse(textBox2.Text)); } if (!result) { AllRight = false; } } catch { AllRight = false; } finally { EnableWorkTextButton(); button1.Text = "Лазить по ссылке"; } if (AllRight) { listBox1.Items.Add("выполнение \"лазанье\" по ссылке " + textBox1.Text); } else { listBox1.Items.Add("ошибка"); } }