下面是WebBrowser的继承类 using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace Test { public class MyWebBrowser : System.Windows.Forms.WebBrowser { #region ExtendedWebBrowserSite class ExtendedWebBrowserSite : WebBrowser.WebBrowserSite, UnsafeNativeMethods.IDocHostShowUI { public ExtendedWebBrowserSite(WebBrowser host) : base(host) { } void UnsafeNativeMethods.IDocHostShowUI.ShowMessage(ref UnsafeNativeMethods._RemotableHandle hwnd, string lpstrText, string lpstrCaption, uint dwType, string lpstrHelpFile, uint dwHelpContext, out int plResult) { plResult = 0; //TODO:自定义 } void UnsafeNativeMethods.IDocHostSh