/// 利用IE浏览器的Com组件在WinForm中显示资源文件中的HTML文件.
///
/// 这里重点有两个:
/// 1. 调用IE的COM组件
/// 2. 调用编译到exe文件中的resource
/// 具体步骤如下,具体用法请查询帮助:
/// 0. 在Project中添加about.htm, 内容自定,属性设置为"Embedded Resource"
/// 1. 在菜单tools->customize toolbox里面选中COM组件"microsot web 浏览器"
/// 2. 在Solution explorer->Test(项目名)->References右键添加Microsoft.mshtml(mshtml.dll)
/// 3. 在WinForm窗体上放置浏览器新增加的浏览器控件axWebBrowser1
/// 4. 添加链接按钮linkAbout
/// 5. 关键代码如下:
private void linkAbout_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
this.navigate("about:blank");
mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)this.axWebBrowser1.Document;
String aboutHtml = this.getStringResource("about.htm");
System.Diagnostics.Debug.Write(aboutHtml);
object[] obj =
///
/// 这里重点有两个:
/// 1. 调用IE的COM组件
/// 2. 调用编译到exe文件中的resource
/// 具体步骤如下,具体用法请查询帮助:
/// 0. 在Project中添加about.htm, 内容自定,属性设置为"Embedded Resource"
/// 1. 在菜单tools->customize toolbox里面选中COM组件"microsot web 浏览器"
/// 2. 在Solution explorer->Test(项目名)->References右键添加Microsoft.mshtml(mshtml.dll)
/// 3. 在WinForm窗体上放置浏览器新增加的浏览器控件axWebBrowser1
/// 4. 添加链接按钮linkAbout
/// 5. 关键代码如下:
private void linkAbout_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
this.navigate("about:blank");
mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)this.axWebBrowser1.Document;
String aboutHtml = this.getStringResource("about.htm");
System.Diagnostics.Debug.Write(aboutHtml);
object[] obj =