System.Globalization Namespace CultureInfo Class
Initializes a new instance of the CultureInfo class based on the culture specified by the culture identifier and on the Boolean that specifies whether to use the user-selected culture settings from the system.
[ VB ]
public Sub New ( _
ByVal culture As Integer, _
ByVal useUserOverride As Boolean _
)
[ C# ]
public CultureInfo (
int culture,
bool useUserOverride
);
[ C++ ]
public: CultureInfo (
int culture,
bool useUserOverride
);
[ JScript ]
function CultureInfo (
culture : int,
useUserOverride : Boolean
);
- culture
- A predefined CultureInfo identifier or the LCID property of an existing CultureInfo.
- useUserOverride
- A Boolean that denotes whether to use the user-selected culture settings ( true ) or the default culture settings ( false ).
The predefined culture identifiers are listed in the CultureInfo class topic.
The culture parameter is mapped to the corresponding National Language Support ( NLS ) locale identifier. The value of the culture parameter becomes the value of the LCID property of the new CultureInfo.
The user might choose to override some of the values associated with the current culture of Windows through Regional and Language Options ( or Regional Options or Regional Settings ) in Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. The useUserOverride parameter denotes whether the current CultureInfo uses those overrides or whether it uses the default values of the culture settings. The value of the useUserOverride parameter becomes the value of the UseUserOverride property.
If the UseUserOverride property is set to true, the properties of the DateTimeFormat instance, the NumberFormat instance, and the TextInfo instance are also retrieved from the user settings. If the user settings are incompatible with the culture associated with the CultureInfo ( for example, if the selected calendar is not one of the OptionalCalendars ), the results of the methods and the values of the properties are undefined.
For cultures that use the euro, the .NET Framework and Windows XP set the default currency as euro; however, older versions of Windows do not. Therefore, if the user of an older version of Windows has not changed the currency setting through Regional Options or Regional Settings in Control Panel, the currency might be incorrect. To use the .NET Framework default setting for the currency, set the useUserOverride parameter to false.
CultureInfo Members CultureInfo Constructor Overload List LCID UseUserOverride