From string to System. Uri

I started working with the Internet in c# and immediately this question arose. How do I make webBrowser read textbox. Text and write it to the url property?

Author: Kyubey, 2012-01-29

2 answers

Something like this:

try {
    webbrowser.Navigate(new Uri(textbox.text));
}
catch (System.UriFormatException e) {
}

Where in textbox.text lies something like http://hashcode.ru/.

 4
Author: stanislav, 2012-01-29 20:36:06
var uri = new Uri(textbox1.Text);

Uri on MSDN.

 1
Author: Pavel S. Zaitsau, 2012-01-29 20:37:15