private
void
button1_Click(
object
sender, EventArgs e)
... {
Regex cRegex = new Regex(@"^http://([w-]+.)+[w-]+(/[w-./?%&=]*)?$");
if (cRegex.Match(urltext.Text.Trim()).Value != "")
...{
webBrowser1.Url = new Uri(urltext.Text.Trim());
}
else
...{
MessageBox.Show("没有输入网址或网址不正确!");
urltext.Text = null;
}
}
... {
Regex cRegex = new Regex(@"^http://([w-]+.)+[w-]+(/[w-./?%&=]*)?$");
if (cRegex.Match(urltext.Text.Trim()).Value != "")
...{
webBrowser1.Url = new Uri(urltext.Text.Trim());
}
else
...{
MessageBox.Show("没有输入网址或网址不正确!");
urltext.Text = null;
}
}