CultureInfo(“ en-US”)不会将异常消息转换为英语

时间:2019-07-05 09:58:01

标签: c# exception cultureinfo

try
{
    ...
}
catch (Exception ex)
{
    CultureInfo.CurrentCulture.ClearCachedData();
    System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
    System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
    MessageBox.Show(ex.Message);
}

但是ex.Message仍以中文显示。我该如何解决?

0 个答案:

没有答案