如何停止Windows Phone应用程序? [英] How to stop Windows Phone Application ?

查看:84
本文介绍了如何停止Windows Phone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

何我可以在catch(){}块中停止他的WindowsPhone应用程序?

Ho can I stop he WindowsPhone Application in catch(){ } blocks ?

try
{
    //Codes
}
catch (Exception)
{
    MessageBox.Show("An Error Has Occured , Please Try Again.");
    //ApplicationStop.
}

推荐答案

停止申请是什么意思?停止什么:导航?应用中的所有主题?当前的方法执行?



我想,你在谈论抛出异常后继续工作。在这种情况下,您只需要阻止阻止,它将阻止您的应用程序崩溃。但是,如果您在调试模式下工作,您将在单独的页面中看到有关此错误的信息,这是正常行为,它在发布应用程序中不可见。



[更新]

如果你想阻止在catch块下面发射所有代码,你应该只在其中调用 return 。 />


ie



What do you mean by "stop application"? Stop what: Navigation? All threads in app? Current method execution?

I suppose, you''re talking about "continue working after an exception was thrown". In this case, you need only catch block, it will prevent your app from crashing. However, if you work in the Debug mode, you''ll see the info about this error in a separate page, that''s normal behaviour, it won''t be visible in release app.

[updated]
If you want to prevent firing all code below the catch block, you should just call return in it.

i.e.

catch
{
   // handling exception
   return;
}


这篇关于如何停止Windows Phone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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