I recently read the. net Resource article and found the following two sentences: Thread. CurrentThread. CurrentUICulture = new CultureInfo ('zh-cn ');
Thread. CurrentThread. CurrentCulture = CultureInfo. CreateSpecificCulture ('zh-cn ');
I am not very familiar with it. After Baidu translation, the following results are obtained:
The two are basically the same. Even if the static CultureInfo. CreateSpecificCulture method is used, it calls the CultureInfo constructor internally. The difference is that when the CultureInfo. CreateSpecificCulture calls the CultureInfo constructor, if an error occurs, it will help you with the necessary processing. When it finds that your parameter cannot be created, CreateSpecificCulture checks whether there is a name starting with this parameter. If yes, it will help you establish it. Therefore, CreateSpecificCulture does not always cause errors.
You can try the following code:
CultureInfo ci = CultureInfo. CreateSpecificCulture ("zh-"); // OK no error
CultureInfo ci = CultureInfo. CreateSpecificCulture ("zh-cn"); // OK no error
CultureInfo ci = CultureInfo. CreateSpecificCulture ("z-cn"); // Error
Therefore, CreateSpecificCulture will only help you with additional checks.