Prevent exception messages from being translated into the user's language?

后端 未结 5 1726
遇见更好的自我
遇见更好的自我 2020-12-14 00:41

How do I make my application always use English when displaying win32/.net exceptions messages?

I got this message, it looks like someone used babelfish to translate

5条回答
  •  旧时难觅i
    2020-12-14 01:06

    How do I make my application always use English when displaying win32/.net exceptions messages?

    First of all, don't show win32/.net exception messages to users. You should handle exceptions rather than showing them to user.

    By default exception messages will be shown in current's UI language (if appropriate language pack is installed, otherwise they fallback to English). You can change exception messages changing Thread.CurrentThread.CurrentUICulture property, however it will affect the whole GUI of your app.

提交回复
热议问题