检查C#中的本地化异常

时间:2018-06-04 11:04:06

标签: c# .net exception-handling

对于Office加载项,应处理ArgumentException消息"The item with the specified name wasn't found"。只要用户使用英文版的MS Office,if-check比较消息就可以正常工作。

如果异常消息被翻译为"Das Element mit dem angegebenen Namen wurde nicht gefunden.",我怎么能用德语说出相同的异常呢?

并发症:

  1. 在这种情况下,内部异常为空。
  2. 另一个HResult
  3. ArgumentException "Value does not fall within the expected range"具有相同的值。
  4. 在这种情况下,
  5. ParamName为空。
  6. 由于这在UI线程中运行,我无法更改异常本地化。
  7. 注意:this unanswered question

    有关

0 个答案:

没有答案
相关问题