webclient.openread() URI Format issue

UrilmSmam

New Member
I am trying to send the uri from a textbox to weblclient instance. The issue is that if I send www.stackoverflow.com it throws the format exception. how to fix this issue? I can't attack the http:// because if the user pastes the correct format then the dynamically attached bit will cause problem.\[code\] protected void TextBoxUrl_TextChanged(object sender, EventArgs e){ HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); using (var wc = new System.Net.WebClient()) { doc.Load(wc.OpenRead(TextBoxUrl.Text),Encoding .UTF8 ); }}\[/code\]
 
Back
Top