以下代码,好像对于有嵌套行为的页面,无效,不过略作修改应该也能兼容所有情况:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace localindex
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.ScriptErrorsSuppressed = true; //禁用错误脚本提示
webBrowser1.IsWebBrowserContextMenuEnabled = false; // 禁用右键菜单
webBrowser1.WebBrowserShortcutsEnabled = false; //禁用快捷键
webBrowser1.AllowWebBrowserDrop = false; // 禁止文件拖动
webBrowser1.Navigate(Application.StartupPath + @"\assets\index.html");
webBrowser1.Document.Window.Error += Window_Error;
webBrowser1.NewWindow +&#