I'm reading a string from a text file, and want to use that string as the URL for my web browser object. The error I get is it needs to be URI, but I am completely lost on how to make a string into URI.
As always, any help is appreciated. :)
Printable View
I'm reading a string from a text file, and want to use that string as the URL for my web browser object. The error I get is it needs to be URI, but I am completely lost on how to make a string into URI.
As always, any help is appreciated. :)
Without seeing what code you are dealing with exactly it's a little bit difficult to say what you want exactly. But if you take this it might provide you with an idea:
vb Code:
Dim myString As String = "http://www.bbc.co.uk" Me.WebBrowser1.Navigate(New Uri(myString))
Thanks! With a little tweaking that worked perfectly.Quote:
Originally Posted by stimbo
For the C# in all of us (even if this is a VB forum...)...
Code:string myUrl = "http://www.vbforums.com";
Uri myUri = new Uri(myUrl);