현재 스레드에 대한 Locale 설정 지원
Contents
[
Hide
]
Aspose.Email은 현재 스레드의 Locale을 설정하는 기능을 제공합니다. Aspose.Email은 클래스를 제공합니다 CurrentThreadSettings 이를 제공하는 setLocale 이 목적을 위한 메서드. 다음 코드 스니펫은 사용을 보여줍니다. CurrentThreadSettings 현재 Locale을 설정하는 클래스. 샘플은 먼저 Locale을 잘못된 값으로 설정한 다음 사용합니다. CurrentThreadSettings.setLocale 현재 스레드의 Locale을 설정하는 메서드.
Locale defaultLocale = Locale.getDefault();
try {
// set incorrect default Locale
Locale.setDefault(new Locale("en", "RU"));
// set Current Thread Locale
CurrentThreadSettings.setLocale("en-US");
// or
// CurrentThreadSettings.setLocale(new Locale("en", "US"));
PersonalStorage.create(dataDir + "test.pst", FileFormatVersion.Unicode);
} finally {
Locale.setDefault(defaultLocale);
}