开发者

c# webcontrol - how to load a html on the fly?

开发者 https://www.devze.com 2023-01-30 20:17 出处:网络
I would like to load HTML using c#\'s webbrowser component. I looked up MSDN, but I can\'t find anything that can load a s开发者_JAVA技巧tring(HTML) into webbrowser component. I only see navigate() me

I would like to load HTML using c#'s webbrowser component. I looked up MSDN, but I can't find anything that can load a s开发者_JAVA技巧tring(HTML) into webbrowser component. I only see navigate() method to load a URL.

so..I would like to the following if possible

String htmlcontent = "<html><head><title>test</title></head><body>my content here</body></html>";

webBrowser1.load(htmlContent) 

something like this..I load that there is no load() method.


You're looking for the DocumentText property.
Note that it's asynchronous; the content will not necessarily loaded when your next line of code runs.

0

精彩评论

暂无评论...
验证码 换一张
取 消