Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Thursday, September 14, 2006

Code for Change Culture in .NET

Description: There will be an error if the culture    setting is different.
For example, Excel is English version but   the OS is not English version or the regional setting
is not English

System.Globalization.CultureInfo oldCI =  System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture =
    new System.Globalization.CultureInfo("en-US");
// add localization codes hereSystem.Threading.Thread.CurrentThread.CurrentCulture
// = oldCI;

Post a Comment