IHTMLWindow2 win = (IHTMLWindow2)webBrowser1.Document.Window.DomWindow;
            string s = "window.alert = null;\r\nwindow.confirm = null;\r\nwindow.open = null;\r\nwindow.showModalDialog = null;";
            win.execScript(s, "javascript");
IHTMLWindow2 是c:\windows\system32\mshtml.tlb 里的接口就这段代码。功能是禁止网页里弹出对话框。我的机子能用,把程序给了我朋友,他打开就不起作用了。为什么啊???