如何使用我的c#应用程序禁用系统生成的错误消息 [英] How can i disable system generated error messages using my c# application

查看:101
本文介绍了如何使用我的c#应用程序禁用系统生成的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我创建了一个Windows应用程序来阻止pc中的应用程序。已完成应用程序阻止,但是当单击被阻止的应用程序时,系统会生成一个对话框,说明由于此计算机上的限制,操作已被取消。请联系系统管理员。我的需要是我不想向用户显示此对话框。我怎么能禁用它。



谢谢,

psk

Hi friends,
I was created a windows application to block the applications in pc. The application blocking was done but when clicking on blocked applications, the system generating a dialog box saying "The operation has been cancelled due to restrictions in effect on this computer. please contact system administrator". My need is i dont want to display this dialog box to user. how can i disable it.

Thank you,
psk

推荐答案

以下是例外情况底层代码或API抛出到调用代码。使用Try Catch块可以捕获特定的异常并向最终用户显示自定义消息。您可以将系统生成的消息用作堆栈跟踪的一部分,以便进一步调试。



如果您不想显示任何消息,那么您将吞下catch块中的所有异常。但这不是一个好习惯。
These are the exceptions that the underlying code or APIs are throwing to the calling code. Using Try Catch block you can catch specific exceptions and display custom messages to the end users, You can use the system generated messages as part of the stack trace for further debugging purpose.

If you don''t want to display any messages, then you swallow all exceptions in the catch block. But this is not a good practice.


这篇关于如何使用我的c#应用程序禁用系统生成的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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