private void btnOK_Click(object sender, EventArgs e)
{
try
{
Uri temp = new Uri(txtUrl.Text);
this.DialogResult = DialogResult.OK;
this.Close();
}
catch (UriFormatException)
{
MessageBox.Show("The provided URL is not valid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}