This documentation is archived and is not being maintained.

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()

ExceptionCondition
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 following code example demonstrates the Register method.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: