【实例简介】
c# winform 打开网页
【实例截图】
【核心代码】
//System.Diagnostics.Process.Start("http://www.qq.com");
//连接
string url = "http://www.qq.com";
//定义脚本
string script = @"
function openUrl(url){
window.open(url,'测试窗口','width=400px,height=400px,directories=true,location=false,menubar=false,resizeable=false,scrollbars=yes,toolbar=false ');
}";
WebBrowser wb = new WebBrowser();
wb.DocumentText = @"
" script "";//定义WebBrowser中的DOM文档wb.DocumentCompleted = delegate
{
//执行脚本函数
wb.Document.InvokeScript("openUrl", new object[] { url });
};