如何将网站与visual studio元素链接起来! [英] how to link website with visual studio elements!

查看:108
本文介绍了如何将网站与visual studio元素链接起来!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试将我的Windows 8商店应用中的按钮与使用 

I am trying to link a button in my windows 8 store app with a website using 

的网站链接等待Launcher.LaunchUriAsync(新的Uri(" http://www.bing.com"));

await Launcher.LaunchUriAsync(new Uri ("http://www.bing.com"));

这个问题是我正在使用公共Wi-Fi和按钮在这种情况下不起作用,只要我断开wi-fi并单击按钮,它就会启动事件并在我的默认浏览器中打开网页。

the problem with this is that I am working with public wi-fi and the button doesn't works in this case, as soon as I disconnect the wi-fi and click the button, It launces the event and opens the webpage in my default browser.

所以我想要知道为什么会出现这样的故障以及它的补救措施是什么?

so I want to know why such a glitch is there and what's the remedy of it?

提前致谢!! 

Thanks in advance !! 

推荐答案

尝试在try块中提供代码并捕获异常

Try to give your code in a try block and catch the Exception

示例

尝试

{

// code

}

catch(例外e)

catch(Exception e)

{

//在此处显示任何消息

// Display any message here

}

现在你的代码可以正常工作

Now your code will work

谢谢Rahul

如果你发现这是答案问题是这个答案

If you find this is the answer for the question mark this as the answer


这篇关于如何将网站与visual studio元素链接起来!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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