C# Web 浏览器导航
我在我的应用程序上打开了浏览器,使用默认的网络浏览器加载数据。
//Set the function and display the browsers we're using (per screen)
browsers[index].Width = screens[index].Bounds.Width;
browsers[index].Height = screens[index].Bounds.Height;
browsers[index].Location = new System.Drawing.Point(screens[index].Bounds.X, screens[index].Bounds.Y);
browsers[index].Navigate(new Uri(lines[index]));
browsers[index].Show();
现在我的问题是,当您单击页面上的链接时,它会离开我的应用程序并完全打开一个新的浏览器。有办法摆脱这个吗?
lines 包含 URL 数组,browser 是要在不同屏幕上加载的网页数组。
I have open browsers on my application which load in data using the default web browser.
//Set the function and display the browsers we're using (per screen)
browsers[index].Width = screens[index].Bounds.Width;
browsers[index].Height = screens[index].Bounds.Height;
browsers[index].Location = new System.Drawing.Point(screens[index].Bounds.X, screens[index].Bounds.Y);
browsers[index].Navigate(new Uri(lines[index]));
browsers[index].Show();
Now my problem is that when you click a link on the page, it leaves my application and openes a new browser completely. Any way of getting out of this?
lines contains an array of URL's and browsers is an array of web pages to load up on different screens.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,这是因为 'TARGET = "_blank"' 发生的,我会尝试在渲染内容之前从标签中删除它。
来源:http://stackoverflow.com/questions/5312275/open-new-web-page-in-new-tab-in-webbrowser-control
If I am not wrong this is happening because of 'TARGET = "_blank"' , I would try removing this this from the tag before the content is rendered.
Source:http://stackoverflow.com/questions/5312275/open-new-web-page-in-new-tab-in-webbrowser-control