加载初始网页
this.webBrowser1.Url = new Uri("http://www.google.com");
加载初始html
webBrowser1.DocumentText =
"<html><body>Please enter your name:<br/>" +
"<input type='text' name='userName'/><br/>" +
"<a href='http://www.microsoft.com'>continue</a>" +
"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>" +
"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>" +
"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"+
"</body></html>";
或
webBrowser1.Navigate(@"D:A est.html");
加载pdf文件
this.webBrowser1.Url = new Uri(@"D:pdfa.pdf");
在html中嵌入pdf
webBrowser1.DocumentText = "<html><body><p><center><h1> PDF in HTML </h1></center></p>" +
"<object classid = 'clsid:CA8A9780-280D-11CF-A24D-444553540000' width = '100%' height = '720'>" +
@"<param name = 'SRC' value = 'D:pdfa.pdf'>" +
@"<embed width = '100%' height = '400' fullscreen = 'yes' src = 'D:pdfa.pdf'>" +
"<noembed></noembed></embed></object></body></html>";