Can a metro app open the default browser without opening a page?

戏子无情 提交于 2020-01-05 04:57:50

问题


On button click I want to open the default metro browser (usually IE) without opening a new tab/page, just open the browser, If it is already running then just switch to it as it is to it's current state. Is there a way to do that?


回答1:


This is just something to try, and may or may not work in your scenario:

If you know the url that is open in the browser, your Windows Store app could launch that same url with the launcher.

In my app, when I launch the same url multiple times, IE will pop up but will not load a second instance of the url.




回答2:


No. The only way to launch the browser is indirectly through the Launcher. The Launcher requires a Uri or a File and it will open the default program associated with that Uri or file type. If it is http, for example, it will launch the default browser. Unfortunately, it seems that the Uri class does not properly parse the about Uri scheme nor will it accept a blank string or http address without a host.



来源:https://stackoverflow.com/questions/14711765/can-a-metro-app-open-the-default-browser-without-opening-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!