在同一浏览器中打开URL [英] Opening the URL in same browser

查看:131
本文介绍了在同一浏览器中打开URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在开发VB.NET Windows应用程序.然后,我将单击一个按钮,将打开一个网站,例如"www.google.com".之后,我最小化了该URL,并开始使用VB.NET应用程序.再次,我将单击Windows窗体中的按钮,它将再次在现有浏览器中打开新的浏览器或选项卡.但是我需要检查浏览器是否已经有一个Google网站.我们需要在同一浏览器中打开该Google,而不是在其他浏览器或选项卡中打开.我该怎么做?

我使用"process.start("http://www.google.com")"代码从VB.NET打开网站.

有什么想法,请让我知道.
提前非常感谢.

Hi,

I am developing a VB.NET Windows application. From that, I will click one button that will open a website for example "www.google.com". After that I minimized that URL and started working on the VB.NET application. Once again, I will click the button in Windows Form that will once again open a new browser or tab in the existing browser. But I need to check if the browser already has a Google site. We need to open that Google in the same browser, not in a different browser or tab... How can I do this?

I used "process.start("http://www.google.com")" code to open the website from VB.NET.

Any ideas, please let me know.
Thanks a lot in advance.

推荐答案

这是不可能的. Process.Start启动默认的浏览器,无论它是什么,它都可以是Firefox,safari,Mozilla(随便命名).即使您知道浏览器并具有进程句柄,要弄清楚如何查找其中包含URL的窗口也将需要一些工作,例如,我希望即使在IE版本之间也会有所不同.
It''s impossible. Process.Start starts the default browser, whatever it is, it could be firefox, safari, Mozilla, you name it. Even if you know the browser, and have the process handle, it would be a bit of work to work out how to find the window that has the URL in it, and I expect even that would differ between versions of IE, for example.


感谢您的回复,我的要求是:如果我通过单击窗口表单上的按钮打开带有url ex(google)的浏览器(默认即),则再次单击同一按钮不关闭现有浏览器就意味着我必须刷新相同的浏览器,不应在新的浏览器或Tab中打开它. 请建议我.
Thanks for your response, my requirement is If i opend a browser (Default ie) with url ex (google) by clicking button on the window form, once again if i click the same button without closing the existing browser means i have to refresh the same browser, it should not open in new browser or Tab..
Please suggest me.


这篇关于在同一浏览器中打开URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆