CultureAndRegionInfoBuilder::Register Method ()

 

Persists the current CultureAndRegionInfoBuilder object as a custom culture on the local computer and makes that culture available to applications. Requires administrative privileges.

Namespace:   System.Globalization
Assembly:  sysglobl (in sysglobl.dll)

public:
void Register()

Exception Condition
InvalidOperationException

The custom culture is already registered.

-or-

The current CultureAndRegionInfoBuilder object has a property that must be set before the culture can be registered. All cultures, neutral or specific, must have TextInfo and CompareInfo set. Specific cultures must also have NumberFormat, GregorianDateTimeFormat, and AvailableCalendars set.

This method also throws InvalidOperationException if the following properties are not defined:

CultureEnglishName

CultureNativeName

CurrencyEnglishName

CurrencyNativeName

ISOCurrencySymbol

Parent

RegionEnglishName

RegionNativeName

ThreeLetterISOLanguageName

ThreeLetterISORegionName

ThreeLetterWindowsLanguageName

ThreeLetterWindowsRegionName

TwoLetterISOLanguageName

TwoLetterISORegionName

ArgumentOutOfRangeException

A CultureAndRegionInfoBuilder object property value exceeds its maximum length or value.

UnauthorizedAccessException

User does not have administrative privileges.

The Register method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Win32 GetWindowsDirectory function. This process is called registering the custom culture. After the custom culture is registered, a new custom culture can be created by specifying the culture name in a CultureInfo constructor or when calling the CultureInfo::CreateSpecificCulture method.

The custom culture can be removed by calling the Unregister method.

The following example demonstrates the Register method.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: