vb.net - Converting a string to an HTML document -
is there way put string variable new declared htmldocument variable without going through webbrowser ? tried
private sub button1_click(sender object, e eventargs) handles button1.click dim v new webclient dim page string = "" dim ahtm htmldocument = nothing page = v.downloadstring("http://www.google.com") ahtm.body.innertext = page 'not working ahtm.write(page) 'not working neither end sub
the reason because declared ahtm nothing. instantiate , see if works.
update: htmldocument wrapper around unmanaged class (ihtmldocument). try declaring webbrower , assigning ahtm web browser document property.
webbrowser wb = new webbrowser(); htmldocument atm = wb.document;
in other words, web browser easiest way.
update: alternative use htmlagilitypack. http://htmlagilitypack.codeplex.com/
Comments
Post a Comment