引用
新建UserControl
//IE 浏览器 // reportUrl = "http://10.10.16.34:9003/report/index?userid=JHICU&deptcode=KS030#"; reportUrl += "?userid=" + ConfigService._User()["USER_ID"].ToString() + "&deptcode=" + dc; WriteTxt("【JHICU.ReportBrowser.UCReportBrowserForm】" + reportUrl); WebBrowser webkitb = new WebBrowser(); webkitb.Navigate(reportUrl); webkitb.Dock = DockStyle.Fill; this.Controls.Clear(); this.Controls.Add(webkitb); //谷歌 浏览器 reportUrl += "?userid=" + ConfigService._User()["USER_ID"].ToString() + "&deptcode=" + dc; WriteTxt("【JHICU.ReportBrowser.UCReportBrowser】" + reportUrl); this.Controls.Clear(); if (!Cef.IsInitialized) { CefSettings settings = new CefSettings(); Cef.Initialize(settings); } ChromiumWebBrowser chromeBrowser = new ChromiumWebBrowser(reportUrl); this.Controls.Add(chromeBrowser); chromeBrowser.Dock = DockStyle.Fill; //谷歌 浏览器 // reportUrl = "http://10.10.16.34:9003/report/index?userid=JHICU&deptcode=KS030#"; reportUrl += "?userid=" + ConfigService._User()["USER_ID"].ToString() + "&deptcode=" + dc; WriteTxt("【JHICU.ReportBrowser.UCReportBrowserNotCef】" + reportUrl); this.Controls.Clear(); WebKitBrowser webkitb = new WebKitBrowser(); webkitb.Navigate(reportUrl); webkitb.Dock = DockStyle.Fill; this.Controls.Add(webkitb);